Simon Slavin wrote: > SELECT rowid FROM NameTable > WHERE name BETWEEN 'P' AND 'PZZZZ' > > This will execute faster if you have an index on 'name' in NameTable. > > [Yes I know 'PZZZZ' is lazy. Until you find someone with that name > (presumably Polish) with that name bite me.]
If the column has text affinity, and if there is an index declared as COLLATE NOCASE, this query will run fast (without case sensitivity) with LIKE: ... WHERE name LIKE 'P%' If the column has text affinity, and if there is a normal (case sensitive) index, this query will run fast with GLOB: ... WHERE name GLOB 'P*' Regards, Clemens