Would glob be faster than like?  Since I assume like has to case-convert?

And you don't have to set any pragmas or NOCASE for it to use the index.



select * from tsamov where tsamov_code glob 'AFG*';



sqlite> explain query plan select * from tsamov where tsamov_code glob 'AFG*';
sele  order          from  deta
----  -------------  ----  ----
0     0              0     SEARCH TABLE tsamov USING INDEX i1 (tsamov_code>? 
AND tsamov_code<?) (~55000 rows)

Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate



________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Igor Tandetnik [itandet...@mvps.org]
Sent: Thursday, July 14, 2011 11:07 AM
To: sqlite-users@sqlite.org
Subject: EXT :Re: [sqlite] Index question about index

On 7/14/2011 12:01 PM, Pavel Ivanov wrote:
>> could the next query use the tsamov_code index ??:
>>     select * from tsamov where tsamov_code like 'AFG%'
>
> Only after
> pragma case_sensitive_like = true;

... or if the index uses COLLATE NOCASE clause.
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to