Re: Using LIMIT 1 in plpgsql PERFORM statements - Mailing list pgsql-performance

From Karl O. Pinc
Subject Re: Using LIMIT 1 in plpgsql PERFORM statements
Date
Msg-id 1130113509l.8670l.1l@mofo
Whole thread Raw
In response to Re: Using LIMIT 1 in plpgsql PERFORM statements  (Josh Berkus <josh@agliodbs.com>)
List pgsql-performance
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


pgsql-performance by date:

Previous
From: "Steinar H. Gunderson"
Date:
Subject: Re: Problem analyzing explain analyze output
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Using LIMIT 1 in plpgsql PERFORM statements