Skip site navigation (1) Skip section navigation (2)

Re: query very slow when enable_seqscan=on

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: query very slow when enable_seqscan=on
Date: 2006-07-04 13:56:29
Message-ID: 13853.1152021389@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-performance
Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl> writes:
> I think because there is no good solution to this - no statistical
> information is going to predict how much data will match a regular
> expression.

Well, it's certainly hard to imagine simple stats that would let the
code guess that, say, "warsa" and "warsaw" match nearly the same
(large) number of rows while "warsawq" matches nothing.

I think the real problem here is that regex matching is the wrong tool
for the job.  Have you looked into a full-text index (tsearch2)?
With something like that, the index operator has at least got the
correct conceptual model, ie, looking for indexed words.  I'm not sure
if they have any decent statistical support for it :-( but in theory
that seems doable, whereas regex estimation will always be a crapshoot.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Tomasz OstrowskiDate: 2006-07-04 14:44:08
Subject: Re: query very slow when enable_seqscan=on
Previous:From: David GagnonDate: 2006-07-04 13:33:20
Subject: Re: Is postgresql ca do the job for software deployed in ASP

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-07-04 14:05:26
Subject: Re: ALTER TYPE ... USING(NULL) / NOT NULL violation
Previous:From: Alexander M. PravkingDate: 2006-07-04 11:03:02
Subject: ALTER TYPE ... USING(NULL) / NOT NULL violation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group