I was originally using LIKE but since that can't make use of indexing I
found this as an alternative to attempt to speed up the query.

So if I wanted to search PHONETIC_KEY LIKE 'ABCD%' I replace it with
PHONETIC_KEY >= 'ABCD' AND PHONETIC_KEY < 'ABCE' 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Friday, June 20, 2008 12:28 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Performance on HP

Hi Andrea,

I'm interested in your query:

Andrea Connell wrote:
> char * qry = "SELECT * FROM LEVEL1 WHERE COUNTRY_ID = ? AND
> DIR_SEARCH_AREA1 = ? AND ADDRESS_TYPE = ? AND PHONETIC_KEY >= ? AND 
> PHONETIC_KEY < ? ;";
>   
> char * qry2 = "SELECT * FROM LEVEL2 WHERE PARENT_KEY = ? AND 
> PRIM_NBR_LOW <= ? AND PRIM_NBR_HIGH >= ?;";
> char* qry3 = "SELECT * FROM LEVEL3 WHERE PARENT_KEY = ? ;";
>   
Are there >= and < on purpose to do lexicographic string ordering? Or
even some kind of Soundex code? Once they caused table scanning, SQLite
page loading may increase?

Best Regards,
/Mike/
_______________________________________________
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