> But If I do "select data from pictures where (x between high_x and low_x)
> and (y between high_y and low_y) then this takes ca. 8 seconds (!) on
> wince.

My sql knowledge may be a little bit rusty and I have really no idea how
sqlite is doing "between" querys. Anyway, once I have learned never to use
between because your query is equivalent to:

where ((x >= high_x and x <= low_x) or (x >= low_x and x <= high_x) and
 (y >= high_y and y <= low_y) or (y >= low_y and y <= high_y))

because of the or operators you will get a union of 4 selects.
Maybe I am wrong but I would expect that "where x >= low_x and x <= high_x
and
y >= low_y and y <= high_y" should be faster and all what you need. You have
indices on x and y, haven't you?

Gerald


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to