Search Postgresql Archives

Re: best practise/pattern for large OR / LIKE searches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




SELECT * FROM tbl WHERE datanumber LIKE '%12345%' OR LIKE '%54321%' OR LIKE '%8766%' OR LIKE '%009%', ..

The number of OR/LIKES are in the order of 50-100 items...
the table tbl is a couple of million rows.

Are the fixed strings in the wildcards "words" (i.e., are they completely arbitrarily embedded in the text, or are they delimited in some regular way)? If they are "words," you might consider using the full text functionality to create an index of them, and searching using that.

--
-- Christophe Pettus
   xof@xxxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux