pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Shortcutting too-large offsets?
Date: Fri, 30 Sep 2011 10:36:50 -0400
Message-ID: <6843.1317393410@sss.pgh.pa.us> (raw)
In-Reply-To: <4E850FC0.509@agliodbs.com>
References: <4E850FC0.509@agliodbs.com>

Josh Berkus <josh@agliodbs.com> writes:
> Here's a case which it seems like we ought to be able to optimize for:
> [ offset skips all the output of a sort node ]
> Is there some non-obvious reason which would make this kind of
> optimization difficult?  Doesn't the executor know at that point how
> many rows it has?

In principle, yeah, we could make it do that, but it seems like a likely
source of maintenance headaches.  This example is not exactly compelling
enough to make me want to do it.  Large OFFSETs are always going to be
problematic from a performance standpoint, and the fact that we could
short-circuit this one corner case isn't really going to make them much
more usable.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <6843.1317393410@sss.pgh.pa.us>
Permalink:  ../6843.1317393410@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6843.1317393410@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com
  Subject: Re: Shortcutting too-large offsets?
  In-Reply-To: <6843.1317393410@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox