Re: Estimation problem with a LIKE clause containing a /

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: "Alexander Staubo" <alex(at)purefiction(dot)net>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Estimation problem with a LIKE clause containing a /
Date: 2007-11-07 13:38:04
Message-ID: 1d4e0c10711070538mf773791ke5950849299b142c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Alexander,

On 11/7/07, Alexander Staubo <alex(at)purefiction(dot)net> wrote:
> That's a difference of less than *three milliseconds* -- a difference
> probably way within the expected overhead of running "explain
> analyze". Furthermore, all three queries use the same basic plan: a
> sequential scan with a filter. At any rate you're microbenchmarking in
> a way that is not useful to real-world queries. In what way are these
> timings a problem?

If you read my previous email carefully, you'll see they aren't a
problem: the problem is the estimation, not the timing. This is a self
contained test case of a far more complex query which uses a bad plan
containing a nested loop due to the bad estimate.

> Now all "like 'prefix%'" queries should use the index.

Not when you retrieve 50% of this table of 22k rows but that's not my
problem anyway. A seqscan is perfectly fine in this case.

Thanks anyway.

--
Guillaume

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-11-07 13:48:36 Re: Segmentation fault using digest from pg_crypto
Previous Message Bruce Momjian 2007-11-07 13:35:31 Re: A small rant about coding style for backend functions

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2007-11-07 16:32:15 Re: index stat
Previous Message Alexander Staubo 2007-11-07 13:25:40 Re: Estimation problem with a LIKE clause containing a /