-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Shaun Seckman
(Firaxis)
Sent: Friday, August 21, 2009 2:33 PM
To: General Discussion of SQLite Database
Subject: [sqlite] Reverse string comparison for searches

Hello everyone,
                Currently, in my database I'm storing thousands of
strings that are formatted in such a way where they share similar
prefixes (i.e. TXT_KEY_FOO, TXT_KEY_BAR).  Sadly, this format cannot be
changed so I was wondering if it would be possible and perhaps faster to
have SQLite perform reverse string comparisons for looking up specific
strings.  Has anyone done this?  Is it practical or worth doing?  These
lookups are performed very frequently so any amount of time that can be
shaved off will be noticed.
-Shaun
=========================================
Hi Shaun,

If you only need to check for exact matches, would adding a column for
an integer hash of the strings be useful?  Of course you'd want to index
it.   You'd want to filter out potential hash collisions with something
like:
   WHERE hash_search = hash_db
   AND   string_search = string_db


 

 

_______________________________________________
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