On 07.02.2011 21:57, Stefan Sperling wrote:
> On Mon, Feb 07, 2011 at 09:32:48PM +0100, Branko Čibej wrote:
>> On 07.02.2011 17:10, Stefan Sperling wrote:
>>> The bug is probabaly in the following query.
>>> Maybe the INSERT OR REPLACE doesn't work as intended?
>>> And why is COMMIT TRANSACTION commented, BTW? Is this the problem?
>>> -- STMT_REPLACE_ACTUAL_PROPS_IN_CACHE
>>> INSERT OR REPLACE INTO temp_query_cache.node_props_cache
>>> (local_relpath, properties)
>>> SELECT N.local_relpath, N.properties
>>> FROM actual_node AS N JOIN temp_query_cache.node_props_cache AS C
>>> ON N.local_relpath = C.local_relpath
>>> AND N.wc_id = C.wc_id;
>> Yes, this query that handles actual_nodes is bogus. I've been looking at
>> fixing it, will update the patch when I find a solution.
>> Or if you like, I can just commit it -- but that'd be throwing code over
>> my shoulder, as there's little chance that I'd have time to maintain
>> such a thing.
> If you prefer, post the patch and I will make sure to understand
> it sufficiently enough to be able to maintain it when it gets committed.
Well, here it is, I fixed the thinko in the actual_props query and got
all prop_tests to pass with this version. Did I say that the way
ACTUAL_NODE is separate from NODE makes these kinds of WC operations
(that merge results from both tables) quite complex and expensive?
There are other differences from the previous patch:
* I use a plain temporary table for the query cache instead of a
temporary database. It turns out that the temp_store pragma
affects even nominally file-backed temporary databases, so there's
no actual difference when using one or the other.
* I introduced a new view to the wc_db schema, called NODES_CURRENT,
which represents a query on NODES that filters out the duplicates
by keeping only the version of each (wc_id, local_relpath) with
the highest op_depth. There are any number of WC operations that
do essentially the same thing in C code, so using this view in the
related SQL queries could simplify the code that processes the
results quite a bit. The addition of this view requires a WC
version bump, also in the patch.
Received on 2011-02-08 23:51:23 CET