On 09/12/2007, D. Richard Hipp <[EMAIL PROTECTED]> wrote:
>
> On Dec 9, 2007, at 5:27 AM, Kees Nuyt wrote:
>
> > Problematic SELECT:
> >> c.execute("""SELECT * FROM entry, word, word_entry WHERE
> >>  entry.id = word_entry.entry_id AND
> >>  word.id = word_entry.word_id AND
> >>  word.word GLOB ?
> >> """, ('hui*',))
> >
>
> SQLite will optimize a GLOB where the right parameter is
> a literal string.  It will not do so if the right parameter is a
> parameter.  http://www.sqlite.org/optoverview.html#like_opt

Hmm, if I replace 'hui*' by 'hu*'

c.execute("""SELECT * FROM entry, word, word_entry WHERE
 entry.id = word_entry.entry_id AND
 word.id = word_entry.word_id AND
 word.word GLOB ?
""", ('hu*',))

the query using bind variables also takes an unmeasurable short time period.

Markus

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

Reply via email to