Re: What is the right way to deal with a table with rows that are not in a random order? - Mailing list pgsql-general

From Tom Lane
Subject Re: What is the right way to deal with a table with rows that are not in a random order?
Date
Msg-id 8057.1243521032@sss.pgh.pa.us
Whole thread Raw
In response to Re: What is the right way to deal with a table with rows that are not in a random order?  (Douglas Alan <darkwater42@gmail.com>)
List pgsql-general
Douglas Alan <darkwater42@gmail.com> writes:
> As I said, in my original post, Postgres's approach would be completely
> reasonable in this case,* if* the rows that it was looking for were
> sprinkled randomly throughout the table.  But they're *not* in this case --
> they're all at the end.

There's been some talk of penalizing the seqscan+limit combination
(perhaps by increasing the estimated start cost for the seqscan) if
the WHERE clause involves any variables that have a correlation stat
significantly different from zero.  But nobody's done the legwork
to see if this would really be useful or what an appropriate penalty
curve might be.

            regards, tom lane

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: ubuntu 9.04 and auto-start
Next
From: Scott Marlowe
Date:
Subject: Re: What is the right way to deal with a table with rows that are not in a random order?