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' > > 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. I would try FTS. > > Thank you all, > Bruno > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > 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 sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users