Re: Synchronized scans

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, Patches <pgsql-patches(at)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: Synchronized scans
Date: 2007-06-04 19:30:02
Message-ID: 20070604193002.GY4779@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
> > For the record, this patch has a small negative impact on scans like
> > "SELECT * FROM foo LIMIT 1000". If such a scan is run repeatedly, in CVS
> > HEAD the first 1000 rows will stay in buffer cache, but with the patch
> > each scan will start from roughly where previous one stopped, requiring
> > more pages to be read from disk each time. I don't think it's something
> > to worry about in practice, but I thought I'd mention it.
>
> Urgh. The answers change depending on (more or less) the phase of the
> moon? I've got a serious problem with that. You might look back to
> 1997 when GEQO very nearly got tossed out entirely because it destroyed
> reproducibility of query results.

What about the simple idea of just disabling the use of a sync scan when
the query has LIMIT and no ORDER BY, and start always at block 0 in that
case?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-06-04 20:24:06 Re: Synchronized scans
Previous Message Jeff Davis 2007-06-04 19:17:49 Re: Synchronized scans