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

From Claudio Freire
Subject Re: Planner hints in Postgresql
Date
Msg-id CAGTBQpaHMyyYCqX8U=X2CBCOipYX27qbbmg9Fyj8AhEN6Cq5Dg@mail.gmail.com
Whole thread
In response to Re: Planner hints in Postgresql  (Jim Nasby <jim@nasby.net>)
Responses Re: Planner hints in Postgresql
Re: Planner hints in Postgresql
List pgsql-hackers

On Mon, Mar 17, 2014 at 7:01 PM, Jim Nasby <jim@nasby.net> wrote:
Even better would be if the planner could estimate how bad a plan will become if we made assumptions that turn out to be wrong.

That's precisely what risk estimation was about.

Something like

SELECT * FROM wherever WHEN id > something LIMIT COST 10000;

Would forbid a sequential scan *if* the table is big enough to suspect the plan might take that much, or a nested loop *if* the planner cannot *prove* it will be faster than that.

I don't believe the limit unit is obscure at all (page fetches being a nice measuring stick), but what is, is what do you do when no plan fits the limits.

pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Planner hints in Postgresql
Next
From: Jim Nasby
Date:
Subject: Re: Planner hints in Postgresql