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
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
pgsql-performance by date
|Next:||From: Tomasz Ostrowski||Date: 2006-07-04 14:44:08|
|Subject: Re: query very slow when enable_seqscan=on|
|Previous:||From: David Gagnon||Date: 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 Lane||Date: 2006-07-04 14:05:26|
|Subject: Re: ALTER TYPE ... USING(NULL) / NOT NULL violation |
|Previous:||From: Alexander M. Pravking||Date: 2006-07-04 11:03:02|
|Subject: ALTER TYPE ... USING(NULL) / NOT NULL violation|