Re: Incorrect assumptions with low LIMITs

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incorrect assumptions with low LIMITs
Date: 2012-03-16 21:39:28
Message-ID: 1331933968.5271.127.camel@sussancws0025
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2012-03-16 at 18:25 +0000, Simon Riggs wrote:
> Any time we apply a LIMIT clause to a plan with a SeqScan or
> unqualified IndexScan, we shouldn't assume the scan will do less than
> say 10% of the table. It might, but its an unsafe assumption because
> as the selectivity decreases so does the safety of the assumption that
> rows are uniformly distributed.

Just trying to follow along. You mean "as the selectivity _increases_
the safety of the assumption that the rows are uniformly distributed
decreases", right?

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-03-16 21:52:55 Re: Command Triggers, patch v11
Previous Message Andres Freund 2012-03-16 21:37:38 Re: Command Triggers, patch v11