On Sat, Sep 4, 2010 at 10:18 AM, Justin Erenkrantz <jus...@erenkrantz.com> wrote: > Notably, AFAICT, we're repeating a few of these queries: > > - STMT_SELECT_WORKING_NODE (2 times) > - STMT_SELECT_ACTUAL_NODE (3 times) > - STMT_SELECT_WORKING_PROPS (2 times) > - STMT_SELECT_BASE_PROPS (2 times) > > I haven't yet dug into why we're repeating the queries.
Okay - I now know why we're repeating the core queries twice. In get_dir_status, we want to do a check to identify if the node exists and what kind it is - which is done by a call to svn_wc__db_read_info (around line 1269 in status.c). But, most of the parameters (except for node and kind) are NULL. If it's not excluded and we can go into the depth, then we call handle_dir_entry on the entry a few lines down - which turns right around and calls svn_wc__db_read_info - this time asking for everything. This causes the core per-file queries to be executed twice. I'm going to see what a quick check to retrieve just the kind and status will do for the query volume. I think it's unlikely we have to pull everything out of sqlite to answer that basic question. -- justin