Revision 3313
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
1322 | 1322 |
add_index(db, distinct_on, new_table, unique=True) |
1323 | 1323 |
add_index(db, distinct_on, table) # for join optimization |
1324 | 1324 |
|
1325 |
insert_select(db, new_table, None, mk_select(db, table, limit=limit),
|
|
1326 |
ignore=True) |
|
1325 |
insert_select(db, new_table, None, mk_select(db, table, order_by=None,
|
|
1326 |
limit=limit), ignore=True)
|
|
1327 | 1327 |
analyze(db, new_table) |
1328 | 1328 |
|
1329 | 1329 |
return new_table |
Also available in: Unified diff
sql.py: distinct_table(): Don't sort the inserted rows by pkey because they should stay in the table order that they were in. (The select order with no ORDER BY should be the table order. Even if it isn't, it doesn't matter what order they are in for our current application.)