Re: OFFSET and LIMIT - performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: OFFSET and LIMIT - performance
Дата
Msg-id 17300.1183054758@sss.pgh.pa.us
обсуждение исходный текст
Ответ на OFFSET and LIMIT - performance  ("Jan Bilek" <bilekj@gmail.com>)
Ответы Re: OFFSET and LIMIT - performance  (David Wall <d.wall@computer.org>)
Re: OFFSET and LIMIT - performance  (Kaloyan Iliev <kaloyan@digsys.bg>)
Список pgsql-general
"Jan Bilek" <bilekj@gmail.com> writes:
> I'm using PGDB with JDBC. In my app i need to select only portion of all =
> available rows. I know i can do it two ways:
> 1. I can use OFFSET and LIMIT SQL statements or
> 2. I can select all rows and then filter requested portion in Java.

> My question - Does the second way significantly affect performance =
> especially when used with JDBC?

Network transmission costs alone would make the second way a loser.

Large OFFSETs are pretty inefficient because the backend generates and
discards the rows internally ... but at least it never converts them to
external form or ships them to the client.  Rows beyond the LIMIT are
not generated at all.

            regards, tom lane

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: [ADMIN] i need a rad/ide open source for work with postgresql
Следующее
От: David Wall
Дата:
Сообщение: Re: OFFSET and LIMIT - performance