Bruno Moreira Guedes
<[EMAIL PROTECTED]> wrote:
> I can split my 'something' in st0, st1, st2, stN... I have a '.'
> betwen this values. But the number of "st"s is undefined. I tried to
> do "the necessary" number comparsions, appending tokens:
>
> SELECT fields FROM sometable WHERE field = 'st0.st1.st2.st3' OR field
> = 'st1.st2.st3' OR field = 'st2.st3' OR field = 'st3';
>
> Unfortunately, even creating a INDEX, the performance was decreased
> instead of being increased.

Try formulating it this way:

SELECT fields FROM sometable WHERE field IN (
    'st0.st1.st2.st3', 'st1.st2.st3', 'st2.st3', 'st3');


As the number of pieces grows, it might be better to create and fill a 
temporary table with suffixes, then do

SELECT fields FROM sometable WHERE field IN
    (select suffix from suffixes);

Igor Tandetnik



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

Reply via email to