On 09/12/2007, Markus Gritsch <[EMAIL PROTECTED]> wrote: > On 09/12/2007, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > > > > 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.
Even more strange: 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 ? """, ('tes*',)) takes less than 1ms but 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 ? """, ('test',)) takes several hundred ms. ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------