Re: query very slow when enable_seqscan=on

From: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: query very slow when enable_seqscan=on
Date: 2006-07-05 08:33:59
Message-ID: 20060705083358.GA570@batory.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-performance

On Tue, 04 Jul 2006, Tom Lane wrote:

> Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl> writes:
> > So why estimate regex expressions if there is no estimation possible?
> > Let's set this estimate to be pessimistic (match everything or
> > everything not null) and it will choose better plans.
>
> Better plans for this specific example, worse plans for other cases.
> Life is not that simple.

It isn't. This worse plans will be choosen only when pattern/regex
matching is used and will be, say, 2 times worse.

What I'm trying to point out is that some people use regular
expressions for filtering rows. When the program is written it is
often impossible to know what data will be put into it. And when a
program is unexpectedly 2000 times slower than normal it is much
worse than if it is 2 times slower, but predictable.

I know Postgres uses probabilistic approach so there's always a
probability that the planner chooses very wrong. But this probability
is so small that it can be ignored. With pattern/regex matching it is
not.

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Gilles 2006-07-05 14:46:16 BUG #2514: (jdbc driver) Multiple inlined statements with mixed updates and queries return wrong results
Previous Message Yann PICHOT 2006-07-05 06:57:00 Fwd: Diffrence between 8.0.3 and 8.1.3

Browse pgsql-performance by date

  From Date Subject
Next Message Markus Schaber 2006-07-05 10:38:20 Re: Is postgresql ca do the job for software deployed in
Previous Message jkapad 2006-07-05 05:54:44 Problem with bitmap-index-scan plan