2008/9/9 P Kishor <[EMAIL PROTECTED]>: > On 9/9/08, Bruno Moreira Guedes <[EMAIL PROTECTED]> wrote: >> Hi people!! >> >> I'm getting problems with a bigger table. I'm doing a query like this: >> >> SELECT field FROM tables WHERE '%.' || somefield LIKE 'somestring' > > interesting variation on the syntax. Usually one would > > WHERE somefield LIKE '%.somestring' > >
Yes... I need to get the rows where 'something' ENDS wifh '.[field-value]'. But I really think this solution isn't very well. >> >> The table has about 500.000 registers. When the table is short, it's >> too fast, but when it's populated it gets slow. I've been imagined it >> before. What may I do to optimize this query?? Should an INDEX help >> me, if it's comparing concatenated strings?? > > LIKE doesn't use INDEXes, so you are really out of luck with big > tables. Try some other approach. On big tables it will be slow, > although 500K "registers" (is a "register" the same as "rows"?) is > not much at all. Yes, with "registers" I'm talking about "rows". 500K rows increased about 34Mb on database's file size. And I fear it's just 'a little', because I'll probably import more 'bigger amounts' of data(each 'amount' with about 500K rows). > > I would try FTS. > > > >> >> Thank you all, >> Bruno >> _______________________________________________ >> sqlite-users mailing list >> [email protected] >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > > -- > Puneet Kishor http://punkish.eidesis.org/ > Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/ > Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/ > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > Thank you by the help, I'll read FTS docs right now!! _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

