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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Douglas Alan <darkwater42(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: What is the right way to deal with a table with rows that are not in a random order?
Date: 2009-05-28 14:30:32
Message-ID: 8057.1243521032@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Douglas Alan <darkwater42(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message inf200468 2009-05-28 14:37:36 [Fwd: Re: a modo texto]
Previous Message Scott Marlowe 2009-05-28 14:30:05 Re: ubuntu 9.04 and auto-start