Checkout
rhuijben
committed
on 25 May 12
Avoid nested full table scans on two tables in a single query by rewriting the
query to a completely different pattern.

Only operate on the… Show more
Avoid nested full table scans on two tables in a single query by rewriting the

query to a completely different pattern.

Only operate on the relevant subset of the actual table to avoid doing unneeded

work on all other nodes in the working copy.

The IN (select local_relpath FROM .. WHERE .. AND kind = 'qqq') style

queries are not optimized by Sqlite to use a select on local_relpath.

Depending on the number of affected nodes and nodes in the working copy, this

query is now orders of magnitude faster.

* subversion/libsvn_wc/wc-queries.sql

 (STMT_UPDATE_ACTUAL_CHANGELISTS): Rewrite query.

* subversion/libsvn_wc/wc_db.c

 (set_changelist_txn): Pass the operation root as second argument.

* subversion/tests/libsvn_wc/wc-queries-test.c

 (slow_statements): Remove another slow statement from the list.

Show less