Re: Using LIMIT 1 in plpgsql PERFORM statements

Поиск
Список
Период
Сортировка
От Karl O. Pinc
Тема Re: Using LIMIT 1 in plpgsql PERFORM statements
Дата
Msg-id 1130113509l.8670l.1l@mofo
обсуждение исходный текст
Ответ на Re: Using LIMIT 1 in plpgsql PERFORM statements  (Josh Berkus <josh@agliodbs.com>)
Список 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 по дате отправления:

Предыдущее
От: "Steinar H. Gunderson"
Дата:
Сообщение: Re: Problem analyzing explain analyze output
Следующее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: Using LIMIT 1 in plpgsql PERFORM statements