Re: Using LIMIT 1 in plpgsql PERFORM statements

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Using LIMIT 1 in plpgsql PERFORM statements
Дата
Msg-id 1130128810.8506.25.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: Using LIMIT 1 in plpgsql PERFORM statements  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-performance
On Sun, 2005-23-10 at 21:36 -0700, Josh Berkus wrote:
> SELECT id INTO v_check
> FROM some_table ORDER BY id LIMIT 1;
>
> IF id > 0 THEN ....
>
> ... that says pretty clearly to code maintainers that I'm only interested in
> finding out whether there's any rows in the table, while making sure I use
> the index on ID.

Why would you want to use the index on ID?

-Neil



В списке pgsql-performance по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Using LIMIT 1 in plpgsql PERFORM statements
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: prepared transactions that persist across sessions?