Checkout Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates

Changeset 1342208 is being indexed.

Provide the Sqlite query plan as part of the error message, to avoid having

to install all kinds of Sqlite versions when problems are reported.

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

(test_query_expectations): Store the already copied rows in an array and

add them to created warnings.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_GE_OP_DEPTH_CHILDREN): Avoid creating a temporary table

by using UNION ALL instead of UNION.

(Without ALL duplicates are filtered by using a temp table)

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

(slow_statements): Remove slow marker.

  1. … 1 more file in changeset.
* subversion/tests/libsvn_wc/wc-queries-test.c

(test_sqlite_version): Grammar tweak.

Wc-queries-test: Remove dependency on libsvn_wc itself. Add version check

as a separate test, to provide a bit more information.

* build.conf

(wc-queries-test): Remove dependency.

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

(includes): Add private/svn_dep_compat.h.

(test_sqlite_version): New function.

(test_parsable): Remove printf, that is now part of test_sqlite_version.

  1. … 1 more file in changeset.
Extend the wc-queries-test application to catch another type of

potentially slow queries: Queries that create temporary tables.

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

(slow_statements): Remove STMT_SELECT_CHANGELIST_LIST as that is now

caught as a result table. Add 3 queries that use a temp table.

(explanation_item): Add some variables.

(parse_explanation_item): Parse COMPOUND and some bits of USE. Set

search type.

(is_result_table): Add changelist_list.

(test_query_expectations): Update tests to handle other info items.

Check for search items before testing fields that may be NULL.

Cleanup the svn ci --include-externals query to use indexes for most of its

work. Use the knowledge that 'parent_relpath = ?' is a subset of

IS_STRICT_DESCENDANT_OF() to at least use some indexing.

* subversion/libsvn_wc/externals.c

(is_external_rolled_out): Externals live in BASE, so use the cheap/direct

api towards that layer, without bothering with copies.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW): Rewrite query.

Remove unused result column. Add missing wc_id in subquery. Just obtain

the repos_id from the wc root, as we can't trust it to be available on

the passed node.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_committable_externals_below): Update column indexes.

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

(STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW): And another one is done.

  1. … 3 more files in changeset.
Help the Sqlite query planner a bit by rewriting two queries in a way that

makes it use indexes, where it didn't before.

* subversion/libsvn_wc/wc-queries.sql

(STMT_RECURSIVE_UPDATE_NODE_REPO,

STMT_SELECT_EXTERNALS_DEFINED): Make the OR operation the outer operation

by duplicating some cheap tests.

(STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW): Accidental change, that should

have been part of the r1341851 change.

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

(slow_statements): Remove two slow statements.

  1. … 1 more file in changeset.
Clean up some loose ends in the streamy property handling.

Rename some statements and apply a generic exception in the statement

validator for tables like the property cache.

No functional changes.

* subversion/libsvn_wc/wc-queries.sql

(STMT_CREATE_NODE_PROPS_CACHE): Rename to...

(STMT_CREATE_TARGET_PROP_CACHE): ... as it is more related to target than

node processing. Remove proof of concept note, as this was part of 1.7.

Rename temporary table to target_prop_cache, to more closely match

our other temporary table names.

Define primary key to avoid a sort when reporting.

(STMT_CACHE_TARGET_PROPS,

STMT_CACHE_TARGET_PRISTINE_PROPS): Update users

(STMT_SELECT_RELEVANT_PROPS_FROM_CACHE): Rename to ...

(STMT_SELECT_ALL_PROP_CACHE):

STMT_DROP_NODE_PROPS_CACHE): Update users.

* subversion/libsvn_wc/wc_db.c

(cache_props_recursive): Update user.

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

(schema_statements): Update reference.

(slow_statements): Remove statement.

(is_node_table): Add final line to allow extending with one line changes.

(is_result_table): New function.

(test_query_expectations): Allow exceptions on scan and index rules on

(temporary) result tables.

  1. … 2 more files in changeset.
Make the recursive property retrieval functions in the wc_db api proportional

to the list of targets instead of to the total size of the working copy.

* subversion/libsvn_wc/wc-queries.sql

(STMT_CREATE_TARGETS_LIST): Add primary key, to give Sqlite a primary index.

(STMT_CACHE_NODE_PROPS): Renamed to ...

(STMT_CACHE_TARGET_PROPS): ... this. Join starting from the targets table

to avoid a wc scan on the nodes table to check for each item if it is

in the targets list. Integrate the STMT_CACHE_ACTUAL_PROPS statement

as that gives us the final result in a single step.

(STMT_CACHE_ACTUAL_PROPS): Remove statement.

Folded into STMT_CACHE_TARGET_PROPS.

(STMT_CACHE_NODE_PRISTINE_PROPS): Renamed to ...

(STMT_CACHE_TARGET_PRISTINE_PROPS): ... this. Join starting with the targets

table. Use a CASE to only fetch properties from below when we have a

base-deleted node.

* subversion/libsvn_wc/wc_db.c

(cache_props_recursive): Remove usage of STMT_CACHE_ACTUAL_PROPS.

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

(slow_statements): Remove three more slow statements.

  1. … 2 more files in changeset.
Avoid a table scan of ACTUAL_NODES for every directory during wc copy

operations by splitting a query into two separate queries that each

use the right index.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_CONFLICT_MARKER_FILES): Split this query into ...

(STMT_SELECT_CONFLICT_MARKER_FILES1): ... this, for the directory and ...

(STMT_SELECT_CONFLICT_MARKER_FILES2): ... this, for the nodes within.

* subversion/libsvn_wc/wc_db.c

(get_conflict_marker_files): New function. Using two queries. Extracted

from ...

(svn_wc__db_get_conflict_marker_files): ... this function.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_get_conflict_marker_files): Remove obsolete comment.

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

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

  1. … 3 more files in changeset.
To remove another slow query, remove a dead code path: streamily retrieving

the op_depth 0 properties.

* subversion/include/private/svn_wc_private.h

(svn_wc__prop_list_recursive): Remove argument.

* subversion/libsvn_client/prop_commands.c

(get_prop_from_wc,

svn_client_proplist3): Update caller.

* subversion/libsvn_wc/props.c

(svn_wc__prop_list_recursive): Remove argument. Update caller.

* subversion/libsvn_wc/wc-queries.sql

(STMT_CACHE_NODE_BASE_PROPS): Remove unused query.

* subversion/libsvn_wc/wc_db.c

(cache_props_baton_t): Remove variable.

(cache_props_recursive): Remove dead code path.

(svn_wc__db_read_props_streamily): Remove argument.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_read_props_streamily): Remove argument.

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

(slow_statements): Remove query.

  1. … 6 more files in changeset.
Split the root node in the target list processing from its children and/or

descendants to avoid a table scan.

Two cheap queries are together much faster than a table scan.

* subversion/libsvn_wc/wc-queries.sql

(STMT_INSERT_TARGET): Reformat.

(STMT_INSERT_TARGET_DEPTH_FILES): Only select files from children.

(STMT_INSERT_TARGET_DEPTH_IMMEDIATES): Only select children.

(STMT_INSERT_TARGET_DEPTH_INFINITY): Only select descendants

(to work the other 7).

(STMT_INSERT_TARGET_WITH_CHANGELIST): Reformat.

(STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_FILES):

Only select files from children.

(STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_IMMEDIATES): Only select children.

(STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY): Only select descendants.

* subversion/libsvn_wc/wc_db.c

(populate_targets_tree): Separate the root from the rest query to improve

performance on large working copies by using the index.

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

(slow_statements): Remove 6 more previously slow queries.

  1. … 2 more files in changeset.
Switch the few remaining queries that still used the LIKE operator to

IS_STRICT_DESCENDANT_OF().

* subversion/libsvn_wc/wc-queries.sql

(STMT_FIND_WC_LOCK,

STMT_SELECT_REVERT_LIST_COPIED_CHILDREN,

STMT_SELECT_REVERT_LIST_RECURSIVE,

STMT_DELETE_REVERT_LIST_RECURSIVE): Use IS_STRICT_DESCENDANT_OF().

* subversion/libsvn_wc/wc_db.c

(construct_like_arg): Remove unused function.

(revert_list_read_copied_children,

svn_wc__db_revert_list_notify): Update user.

(wclock_obtain_cb): Remove unused variable. The code was accidentally

already updated to use the local_relpath in r1341690.

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

(slow_statements): Remove 3 more previously slow queries.

(is_node_table): Handle wc_lock as node table for measurements.

  1. … 2 more files in changeset.
Remove a few wcroot specific queries that can now safely use the generic

variant without any measurable performance penalty.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_NODES_ABOVE_DEPTH_RECURSIVE,

STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE,

STMT_CLEAR_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE,

STMT_HAS_SERVER_EXCLUDED_DESCENDANTS): Remove obsolete comments.

(STMT_DELETE_ALL_NODES_ABOVE_DEPTH,

STMT_DELETE_ALL_ACTUAL_NODE_LEAVING_CHANGELIST,

STMT_CLEAR_ALL_ACTUAL_NODE_LEAVING_CHANGELIST,

STMT_SELECT_ALL_EXCLUDED_NODES): Remove statements.

* subversion/libsvn_wc/wc_db.c

(catch_copy_of_server_excluded,

op_revert_recursive_txn): Update caller.

(wclock_obtain_cb): Accidental variable usage change that should have

been part of my next commit.

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

(slow_statements): Remove slow statements.

  1. … 2 more files in changeset.
Redefine our Sqlite IS_STRICT_DESCENDANT_OF() macro to allow operating on the

"" relpath. This removes the need of duplicating queries for the root and

subtrees, without losing performance on the subtree case.

The full tree would use an index to select on wc_id anyway, so adding

an extra key doesn't slow it down.

* build/transform_sql.py

(process_file): Redefine IS_STRICT_DESCENDANT_OF().

* subversion/libsvn_wc/wc-queries.sql

(STMT_CLEAR_BASE_NODE_RECURSIVE_DAV_CACHE,

STMT_RECURSIVE_UPDATE_NODE_REPO,

STMT_INSERT_TARGET_DEPTH_INFINITY,

STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY,

STMT_DELETE_WC_LOCK_ORPHAN_RECURSIVE,

STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW,

STMT_SELECT_EXTERNALS_DEFINED,

STMT_SELECT_EXTERNAL_PROPERTIES,

STMT_SELECT_MIN_MAX_REVISIONS,

STMT_HAS_SPARSE_NODES,

STMT_SUBTREE_HAS_TREE_MODIFICATIONS,

STMT_SUBTREE_HAS_PROP_MODIFICATIONS,

STMT_SELECT_BASE_FILES_RECURSIVE):

Remove now unneeded ?X = '' subexpressions.

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

(slow_statements):

Remove statements that started using indexes by this change.

  1. … 2 more files in changeset.
Fix the name of the actual table in the wc-queries-test, to properly detect

slow usages of this table.

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

(slow_statements): Add slow tests on the actual_node table.

(is_node_table): Update table name.

Fix a hidden bug in the merge handling and a slow wc.db query.

* subversion/include/private/svn_wc_private.h

(svn_wc__get_server_excluded_subtrees): Rename to ...

(svn_wc__get_excluded_subtrees): ... this. Update documentaton.

* subversion/libsvn_client/merge.c

(get_mergeinfo_paths): Update caller, that really just needs a list

of paths that are not there.

* subversion/libsvn_wc/node.c

(svn_wc__get_server_excluded_subtrees): Rename to ...

(svn_wc__get_excluded_subtrees): ... this. Update caller.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_ALL_EXCLUDED_NODES): Remove selection of node itself and wcroot.

Also select excluded nodes.

(STMT_SELECT_ALL_EXCLUDED_WCROOT): New statement, like

STMT_SELECT_ALL_EXCLUDED_NODES, but specialized to use on the wcroot.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_get_server_excluded_subtrees): Rename to ...

(svn_wc__db_get_excluded_subtrees): ... this. Use separate new queries.

Don't ask for copying in the scratch pool if we are copying it to

result_pool within its original lifetime

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_get_server_excluded_subtrees): Rename to ...

(svn_wc__db_get_excluded_subtrees): ... this. Update documentaton.

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

(slow_statements): Add STMT_SELECT_ALL_EXCLUDED_WCROOT to the operationg

on the entire wc list. Remove STMT_SELECT_ALL_SERVER_EXCLUDED_NODES as

it properly uses an index instead of a table scan now.

  1. … 6 more files in changeset.
* subversion/tests/libsvn_wc/wc-queries-test.c

(slow_statements):

Apply result from review of STMT_DELETE_PRISTINE_IF_UNREFERENCED statement.

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

(test_parsable): Print runtime sqlite version, to help in diagnosing errors.

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

(headers): Following up on r1341232, undo accidental commit of my local

amalgamation test.

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

(test_query_expectations): Avoid a possible segfault with Sqlite 3.7.2.

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

(slow_statements): Remove statements that are not slow with the current

ruleset.

(test_query_expectations): Update evaluation to allow reporting not-slow

nodes.

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

(test_query_expectations): Simplify and consolidate sqlite capability

detection.

Make wc-queries-test failures much easier to diagnose by extending the sqlite

transform script a bit. Store names and some optional value during .sql

parsing and make that information available in the test.

* build/transform_sql.py

(Processor): Extend regex to capture flags.

(_sub_statement): Generate extra macro.

(main): Generate a DECLARE_STATEMENT_INFO macro.

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

(wc_query_info): New static variable.

(test_parsable,

test_query_expectations): Extend error messages with statement name.

  1. … 1 more file in changeset.
Following up on r1341130, fix the bug that the code only parsed the statements

until the first statement that contained multiple queries.

Record current 'slow' queries, based on Sqlite 3.7.12 results.

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

(slow_statements): Add a lot of statements.

(parse_explanation_item): Detect 'USE' operation.

(test_query_expectations): Continue instead of break on parse errors and

multi-statements. Check for primary key usage first and allow 'slow'

suppression for all checks.

Fix integer size mismatch.

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

(parse_explanation_item): Use size_t for the result of strlen().

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

(test_query_expectations): Use a different method to detect

SQLITE_OMIT_EXPLAIN compilation option of Sqlite.

Add some simple query plan evaluation test in the wc-queries-test. This

test passes for Sqlite 3.7.12, but might (and probably will) fail for

older Sqlite versions that lack specific optimizations.

Yes it would be much nicer to implement this in a script language...

But no, that wouldn't help as that might test a different Sqlite

version than Subversion.

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

(slow_statements): New list.

(is_schema_statement): Renamed to in_list and add list argument.

(is_slow_statement,

is_schema_statement): New macros.

(explanation_item): New struct.

(parse_explanation_item): New function.

(is_node_table): New function.

(test_query_expectations): New function.

(test_funcs): Add test_query_expectations.

Another attempt of fixing the linking/compilation of wc-queries-test.c for

sqlite amalgamation users.

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

(includes): Add svn_private_config.h

(test_parsable): Rename pool argument.

Add a raw test application to test preparing all our working copy queries on

Sqlite. The current version just parses all queries, but I intend to add

support to verify some aspects of the query plan in a later patch.

The fix in r1340998 was a direct result of writing this test.

* build.conf

(wc-queries-test): New test.

(__ALL_TESTS__): Add wc-queries-test.

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

New file.

  1. … 1 more file in changeset.