[elephant-devel] Ditching Darcs

Alex Mizrahi killerstorm at newmail.ru
Tue Oct 28 17:52:53 UTC 2008


 LPP> I must've missed something or unintentionally used a db
 LPP> with older stuff already in it.

yep, old format database could be the case if you've got it broken
at start.

but it seems our current tests are broken, so you get always get some
error on the first run regardless of backend used.

 LPP> How about the NIL problem with secondary indices, you tried
 LPP> to tackle that?

not really, so far :(

i thought some more about approach with NULLs and wrote down
queries and cases needed to handle NULLs -- it appears to be
more realistic now than it was before, but still pretty hairy, so i've
abandoned this for a while..

for example, cursor-next uses query

WHERE (qi > $1) OR ((qi = $1) AND (value > $2))

and cursor-prev uses query

WHERE (qi < $1) OR ((qi = $1) AND (value < $2))

being similar, they are made via template "WHERE (qi ~a $1) OR ((qi = $1) 
AND (value ~a $2))" now.

but with nulls that would be four different queries:

cursor-next:
 key is null:        (qi IS NULL) and (value > $2)
 key is not null:  (qi > $1) OR (qi IS NULL) OR ((qi = 1) AND (value > $2)
cursor-prev
 key is null:        (qi IS NOT NULL) OR ((qi IS NULL) AND (value < $2))
 key is not null:  (qi < $1) OR ((qi = $1) AND (value < $2))

and taking into account other cursor operations, instead of 3 query 
templates
we now have something like 12 different queries now, and i see any pattern
how they can be merged :(
or maybe it makes sense to ditch templated query generations and just write
these conditions manually 







More information about the elephant-devel mailing list