[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SQL to get WORKING from NODES

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 24 Sep 2010 15:26:56 +0100

Greg Stein <gstein_at_gmail.com> writes:

> Step back and look at that code.
> The gather_children() got a bit more complicated because I was trying
> to get the list of children from BASE_NODE and WORKING_NODE, and union
> those together (or skip the union altogether in certain cases). With
> NODES, it becomes one simple query:
> SELECT DISTINCT local_relpath FROM nodes
> WHERE wc_id = ?1 AND parent_relpath = ?2;
> Done.
> Pass that query to single_table_children() and return.
> count_children, add_children_to_hash, and union_children can all be
> eliminated with SVN_WC__NODES_ONLY.

Yes, but in the short term NODES is going to look like BASE/WORKING.

>>> This leads on to the problem of selecting just the highest op_depth
>>> for each child.  Is it possible to get one query to return just the
>>> highest op_depth for each child?
>> I suspect we will still want to do this at some point.
> Maybe. The query that you have (a self join) should work but is quite
> expensive, so let's hope you won't need it often.

We need something. Status is too slow when it does per-node queries,
so we need to switch to per-dir queries. Do a per-dir query for
children, cache the data, and then iterate over the children to
produce the status. That was the only way my prototype for single-db
was fast enough. Now I suppose we could get all children at all
op_depths and discard some, but we really only want the zero and max

Received on 2010-09-24 16:27:51 CEST

This is an archived mail posted to the Subversion Dev mailing list.