Re: Query advice request
От
Mladen Gogala
Тема
Re: Query advice request
Дата
Msg-id
4CB0B337.7030208@vmsinfo.com
Ответ на
Query advice request (Mark Kelly)
Список
Дерево обсуждения
Query advice request Mark Kelly <pgsql@wastedtimes.net>
Re: Query advice request Mladen Gogala <mladen.gogala@vmsinfo.com>
Re: Query advice request Mark Kelly <pgsql@wastedtimes.net>
Mark, you should be using text indexes. You are looking for the whole words and the regular expression will not use an index. If you want speed, at least one of the two columns in your query should be indexed with a text index. Mark Kelly wrote: > Hi. > > I'm wondering if there is a better way to do this: > > SELECT news.id FROM news > WHERE news.headline ~* '(japan|office)' > OR news.body ~* '(japan|office)' > ORDER BY news.posted DESC; > > It is for small articles; a few hundred or so rows in the table and not > expecting millions. > > Cheers, > > Mark > > -- Mladen Gogala Sr. Oracle DBA 1500 Broadway New York, NY 10036 (212) 329-5251 www.vmsinfo.com
В списке pgsql-novice по дате отправления