Well, behaviour of deterministic function is really strange. 
SELECT x, sequence() AS y FROM t1 WHERE y>0 AND y<99 AND y!=55 AND y NOT IN
(56,57,58) AND y NOT LIKE 'abc%' AND y%10==2 order by x desc
(Example from alias.test, I have declared sequence() with
SQLITE_DETERMINISTIC flag)
Trace for the query above:
...
Function0         0    0    1 sequence(0)   00 r[1]=func(r[0])
Integer            0    2    0                      00 r[2]=0
Integer           99    3    0                     00 r[3]=99
Integer           55    4    0                     00 r[4]=55
String8            0   13    0 abc%            00 r[13]='abc%'
Function0         0    0   14 sequence(0)   00 r[14]=func(r[0])
Function0         3   13    8 like(2)          02 r[8]=func(r[13..14])
Function0         0    0    7 sequence(0)  00 r[7]=func(r[0])
...
sequence() is called 3 times in trace(even without branching), instead of
using register r[1] after first call.





--
Sent from: http://sqlite.1065341.n5.nabble.com/
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to