X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 99698DAAA7 for ; Sun, 23 Oct 2005 18:01:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62665-08 for ; Sun, 23 Oct 2005 21:01:02 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id EE2F4DAA87 for ; Sun, 23 Oct 2005 18:01:03 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 8334110; Sun, 23 Oct 2005 14:03:34 -0700 From: Josh Berkus Organization: Aglio Database Solutions To: pgsql-performance@postgresql.org Subject: Re: Using LIMIT 1 in plpgsql PERFORM statements Date: Sun, 23 Oct 2005 14:02:35 -0700 User-Agent: KMail/1.8 Cc: "Karl O. Pinc" References: <1129957521l.27845l.2l@mofo> In-Reply-To: <1129957521l.27845l.2l@mofo> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510231402.35612.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.114 required=5 tests=[AWL=-0.093, UPPERCASE_25_50=0.207] X-Spam-Level: X-Archive-Number: 200510/319 X-Sequence-Number: 15087 Karl, > PERFORM 1 FROM foo; > IF FOUND THEN ... > > is any slower than: > > PERFORM 1 FROM foo LIMIT 1; > IF FOUND THEN ... I'm wondering in what context it makes sense to call PERFORM on a constant. -- Josh Berkus Aglio Database Solutions San Francisco