Revision 3303
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
580 | 580 |
table = sql_gen.as_Table(table) |
581 | 581 |
run_query(db, 'LOCK TABLE '+table.to_str(db)+' IN '+mode+' MODE') |
582 | 582 |
|
583 |
def run_query_into(db, query, into=None, add_indexes_=False, **kw_args):
|
|
583 |
def run_query_into(db, query, into=None, add_pkey_=False, **kw_args):
|
|
584 | 584 |
'''Outputs a query to a temp table. |
585 | 585 |
For params, see run_query(). |
586 | 586 |
''' |
... | ... | |
611 | 611 |
into.name = next_version(into.name) |
612 | 612 |
# try again with next version of name |
613 | 613 |
|
614 |
if add_indexes_: add_indexes(db, into)
|
|
614 |
if add_pkey_: add_pkey(db, into)
|
|
615 | 615 |
|
616 | 616 |
# According to the PostgreSQL doc, "The autovacuum daemon cannot access and |
617 | 617 |
# therefore cannot vacuum or analyze temporary tables. [...] if a temporary |
Also available in: Unified diff
sql.py: run_query_into(): Changed add_indexes_ param to add_pkey_ and add just a pkey if it's set. It's no longer necessary to create indexes on every column of a temp table, because the covering indexes for the join columns have been fixed to have columns in the same order as the output table's corresponding index so that they can be used for a merge join.