pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karl O. Pinc <kop@meme.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Using LIMIT 1 in plpgsql PERFORM statements
Date: Mon, 24 Oct 2005 00:25:09 +0000
Message-ID: <1130113509l.8670l.1l@mofo> (raw)
In-Reply-To: <200510231402.35612.josh@agliodbs.com>
References: <1129957521l.27845l.2l@mofo>
	<200510231402.35612.josh@agliodbs.com>


On 10/23/2005 04:02:35 PM, Josh Berkus wrote:
> 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.

If you want to find out if the table has any rows.
I'm really interested in what happens when
there's a WHERE qualification.  I want to find
out if there's any of some particular sort of row.
But I figured it wasn't worth putting that into
the example because I didn't have anything
specific to put in the WHERE clause.  I suppose
I should have put it in anyway and followed with ....

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein




view thread (6+ messages)  latest in thread

Message-ID: <1130113509l.8670l.1l@mofo>
Permalink:  ../1130113509l.8670l.1l@mofo/
Also on:    postgresql.org/message-id/1130113509l.8670l.1l@mofo

 · 

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: kop@meme.com, josh@agliodbs.com
  Subject: Re: Using LIMIT 1 in plpgsql PERFORM statements
  In-Reply-To: <1130113509l.8670l.1l@mofo>

* 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