Simon,

this is a direct CUT and PASTE from my code:

#define SQL_GET_NEXT_SLIDE_SHOW_IMAGE \
        "SELECT FolderId, ImageId, instertedon " \
      "FROM V_FAVORITES_SELECTED " \
     "WHERE instertedon > julianday(@time) AND findLargeImage(@path,
FolderId, ImageId) = 1 " \
     "LIMIT 1"

When I set a break point on the findLargeImage() function, it gets
called once for every row in the result set from [SELECT FolderId,
ImageId, instertedon FROM V_FAVORITES_SELECTED], the WHERE instertedon
> julianday(@time) and the LIMIT 1 is NOT taken into account.  Thus,
the findLargeImage() is *NOT* short-circuiting the query.

Sam

On Sun, Jun 20, 2010 at 6:02 PM, Simon Slavin <[email protected]> wrote:
>
> On 20 Jun 2010, at 10:40pm, Sam Carleton wrote:
>
>> I am getting the EXACT same result, it calls findImage on for EVERY
>> row in the result set.  The goal is to have the findImage()
>> short-circuit the where clause so that once it returns 1 one time, it
>> stops.  Aka lots of 0's can be returned, but only one 1.
>
> Then forget the fancy clause and just use LIMIT 1.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to