Re: LIMIT confuses the planner

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: kouber(at)saparev(dot)com, pgsql-performance(at)postgresql(dot)org
Subject: Re: LIMIT confuses the planner
Date: 2009-02-23 15:09:49
Message-ID: 3562.1235401789@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> If you left seq_page_cost (which isn't mentioned here) at the default
> value but reduced random_page_cost to 0.1, then you have
> random_page_cost < seq_page_cost. That's probably Bad.

... well, it's certainly going to push the planner to believe indexscans
are cheaper than sorts no matter what.

The previously noted rowcount estimation problem might be a bigger issue
in this particular case, but I agree this is a Bad Idea.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kouber Saparev 2009-02-23 17:42:18 Re: LIMIT confuses the planner
Previous Message Robert Haas 2009-02-23 14:53:41 Re: LIMIT confuses the planner