Greg Stein <gst...@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
op_depths.

-- 
Philip

Reply via email to