Re: bad query plans for ~ "^string" (and like "string%") (8.3.6)

From: Marinos Yannikos <mjy(at)geizhals(dot)at>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: bad query plans for ~ "^string" (and like "string%") (8.3.6)
Date: 2009-04-08 13:50:58
Message-ID: 49DCABC2.6030406@geizhals.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Marinos Yannikos wrote:
> (what exactly does ANALYZE look at for text columns? in our case, about
> 7% of the rows match the index condition, so it seems that left-anchored
> regexp/like matches are not evaluated using the gathered
> most-common-value list at all)

oops, I think I gave myself the answer there. Of course the
most-common-value list will not help if all the values that match the
"bad" index condition exist only once, but have a common prefix...

Perhaps Postgres could sample the first few characters separately for
such queries, but it's probably not worth it.

Regards,
Marinos

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2009-04-08 13:53:58 Re: bad query plans for ~ "^string" (and like "string%") (8.3.6)
Previous Message Marinos Yannikos 2009-04-08 13:42:12 bad query plans for ~ "^string" (and like "string%") (8.3.6)