From: | Vassili A Akimov <vassili(at)erols(dot)com> |
---|---|
To: | Andrew Snow <als(at)fl(dot)net(dot)au> |
Cc: | "Pgsql-General(at)Postgresql(dot) Org" <pgsql-general(at)postgresql(dot)org>, mitch(at)venux(dot)net |
Subject: | Re: Need to improve performance |
Date: | 2000-06-23 17:43:52 |
Message-ID: | 3953A1D8.DF3392CD@erols.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-sql |
Andrew Snow wrote:
> > So we were advised to use "fulltextindex".- chunk
> > this fields on single words and make new table with words and oids in
> > it. After we made this table its size was 2940360 records. And I tried
> > to measure the time:
> >
> > ....
> >
> > select f1.id from app_fti f1, app_fti f2 where f1.string~*'visual' and
> > f2.string~*'basic' and f1.id=f2.id;
>
> What is causing it to be so slow is the use of regular expression pattern
> matching. For reasons I don't know, regular expression evaluation in a
> query is fairly slow in PostgreSQL. But since you have (correctly, I think)
> made a full text index, why do you still need to use regexp's ?
>
> Replace the ~* operator in the query above with 'LIKE', and you should find
> it several times faster.
>
> Please let us know the results of your testing.
>
> - Andrew
Thank you gentelmen! It seems that regexp was the reason! I enabled
likeplanning and it i=didn't improve the performance until I replaced '~*' with
'LIKE'. Thank you again!
V.
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Mercer | 2000-06-23 17:54:16 | Re: followup to SELECT/INSERT problem |
Previous Message | Robert B. Easter | 2000-06-23 16:53:18 | Re: Conditions in PostGres SQL |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2000-06-23 18:06:50 | Re: Need to improve performance |
Previous Message | D'Arcy J.M. Cain | 2000-06-23 16:39:10 | Re: Using substr with user defined types |