X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id C2299B438AC for ; Mon, 7 Jul 2003 22:47:18 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 59622-03 for ; Mon, 7 Jul 2003 19:47:07 -0300 (ADT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by svr1.postgresql.org (Postfix) with ESMTP id 5B99DB430D7 for ; Mon, 7 Jul 2003 19:47:07 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id D8708D660; Mon, 7 Jul 2003 15:47:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id CE1355C0C; Mon, 7 Jul 2003 15:47:06 -0700 (PDT) Date: Mon, 7 Jul 2003 15:47:06 -0700 (PDT) From: Stephan Szabo To: Markus Bertheau Cc: Subject: Re: avoid select expens_expr(col) like unneccessary calculations In-Reply-To: <1057617306.2617.6.camel@saphir> Message-ID: <20030707154329.J82767-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/81 X-Sequence-Number: 14195 On 8 Jul 2003, Markus Bertheau wrote: > when you have > select expensive_expression(column), * from table offset 20 limit 40 > > can you somehow save the cost for the first 20 calculations of > expensive_expression? Right now the only way I can think of that might work is to push the offset/limit into a subselect on table and then do the expensive_expression at the top level.