I know the bad way...what is the good way?

Поиск
Список
Период
Сортировка
От Rick Schumeyer
Тема I know the bad way...what is the good way?
Дата
Msg-id 454B4CC8.4070705@ieee.org
обсуждение исходный текст
Ответы Re: I know the bad way...what is the good way?
Re: I know the bad way...what is the good way?
Список pgsql-general
I confess to having once written code that prints something like
"Items # 1 to 10 of 45"
by using select count(*) from t where condition; and select * from t
where condition limit 10 offset x;

I now know this is "bad", I guess because of the count() and the offset.

So what is the preferred way?  If it matters, my new application is
servlet based, so I believe (but not positive) this means cursors are an
option?  Is this a better way to do this?

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

Предыдущее
От: Richard Troy
Дата:
Сообщение: Re: Counting records in a PL/pgsql cursor
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: Counting records in a PL/pgsql cursor