Re: Planner hints in Postgresql - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Planner hints in Postgresql
Date
Msg-id 20140317175846.GM26394@tamriel.snowman.net
Whole thread Raw
In response to Re: Planner hints in Postgresql  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: Planner hints in Postgresql
List pgsql-hackers
* Merlin Moncure (mmoncure@gmail.com) wrote:
> Yeah -- the most common case I see is outlier culling where several
> repeated low non-deterministic selectivity quals stack reducing the
> row count estimate to 1.  For example:
> SELECT * FROM foo WHERE length(bar) <= 1000 AND length(bar) >= 2;

This is exactly the issue that I've seen also- where we end up picking a
Nested Loop because we think only one row is going to be returned and
instead we end up getting a bunch and it takes forever.

There was also some speculation on trying to change plans mid-stream to
address a situation like that, once we realize what's happening.  Not
sure that's really practical but it would be nice to find some solution.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: First-draft release notes for next week's releases
Next
From: Atri Sharma
Date:
Subject: Re: Planner hints in Postgresql