Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 166F5B5DBE3 for ; Fri, 30 Sep 2011 15:44:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 62689-05 for ; Fri, 30 Sep 2011 18:44:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smtp-out-1.01.com (smtp.01.com [216.115.88.169]) by mail.postgresql.org (Postfix) with ESMTP id E064BB5DBC7 for ; Fri, 30 Sep 2011 15:44:31 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id A3B8D9D0529 for ; Fri, 30 Sep 2011 13:44:31 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp-out-1.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YqxrbJW7cb5A for ; Fri, 30 Sep 2011 13:44:31 -0500 (CDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 647339D0542 for ; Fri, 30 Sep 2011 13:44:31 -0500 (CDT) Received: from Sidney-Stratton.local (70-36-143-92.dsl.dynamic.sonic.net [70.36.143.92]) by smtp-out-1.01.com (Postfix) with ESMTPSA id 2244C9D0525; Fri, 30 Sep 2011 13:44:31 -0500 (CDT) Message-ID: <4E860E09.7090107@agliodbs.com> Date: Fri, 30 Sep 2011 11:44:25 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Tom Lane CC: postgres performance list Subject: Re: Shortcutting too-large offsets? References: <4E850FC0.509@agliodbs.com> <6843.1317393410@sss.pgh.pa.us> In-Reply-To: <6843.1317393410@sss.pgh.pa.us> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/441 X-Sequence-Number: 45217 Tom, > 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. It's not that uncommon of a corner case though; it's one which happens all the time in webapps which paginate. People just have to ask for a page after the end. It's really a question of how simple the code to make the optimization would be; if it would be a 5-line patch, then it's worth it; if it would be a 110-line refactor, no. Lemme see if I can figure it out ... -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com