X-Original-To: pgsql-admin@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 8A94D47634A for ; Wed, 12 Mar 2003 18:40:14 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2CNeFub000478; Wed, 12 Mar 2003 18:40:15 -0500 (EST) To: Stephan Szabo Cc: Chris Mungall , pgsql-admin@postgresql.org Subject: Re: Using functions as filters in queries In-reply-to: <20030312150753.H58222-100000@megazone23.bigpanda.com> References: <20030312150753.H58222-100000@megazone23.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Wed, 12 Mar 2003 15:09:17 -0800" Date: Wed, 12 Mar 2003 18:40:14 -0500 Message-ID: <477.1047512414@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/173 X-Sequence-Number: 7813 Stephan Szabo writes: > On Wed, 12 Mar 2003, Tom Lane wrote: >> I think the extra step to make this expression indexable is probably not >> too hard: the constant-expression folder needs to be taught that >> extracting a field from a whole-row Var can be replaced by a Var >> reference to the field, ie, fold "(t.*).n" into "t.n". > That's what I figured, but I wasn't sure if there was some case where it > was unsafe. I haven't thought it through either, but this particular example seems safe. regards, tom lane