2008/9/9 Igor Tandetnik <[EMAIL PROTECTED]>:
> "Bruno Moreira Guedes"
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Yes... I need to get the rows where 'something' ENDS wifh
>> '.[field-value]'. But I really think this solution isn't very well.
>
> Can field-value contain a period? If not, you can just extract the
> portion of 'something' after the last period, then run a straight
> comparison: WHERE somefield='tail-of-somestring' . Such a comparison can
> then be sped up with an index.
>
> Igor Tandetnik
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

Igor,

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.

Now I'm thinking about using length() to filter where the strings will
be compared... After some testing, I increased a little of the
performance, but it still very bad!!

I still looking for hints!!

Thank you
Bruno M Guedes
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to