From: | "Arguile" <arguile(at)lucentstudios(dot)com> |
---|---|
To: | "Ulrich Wisser" <liste(at)publisher(dot)de>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: full text index |
Date: | 2002-02-10 22:18:23 |
Message-ID: | LLENKEMIODLDJNHBEFBOIEGHECAA.arguile@lucentstudios.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> SELECT kw,hits from keywords where kw like'%xyz%';
Using regular expressions in this case is much faster than LIKE, see
http://www.postgresql.org/idocs/index.php?functions-matching.html
> What is the most efficient way to do it? The table
> will have around 3 to 4 million rows. So a full
> table scan is out of question. I need the answer in
> around one second. (It's a web application)
This will still need to do that, if they're keywords you should be doing an
exact match on them, else don't maintain an index that won't be used.
You may be interested in full text searching which can be found in
/contrib/fulltextindex (IIRC) or http://openfts.sourceforge.net .
From | Date | Subject | |
---|---|---|---|
Next Message | will trillich | 2002-02-10 22:29:50 | Re: another "EXPLAIN -- NO INDEX?" question |
Previous Message | Ulrich Wisser | 2002-02-10 21:54:59 | full text index |