OFFSET and LIMIT - performance

Поиск
Список
Период
Сортировка
Искать
От
Jan Bilek
Тема
OFFSET and LIMIT - performance
Дата
Msg-id
001501c7b9a3$79e2c120$0100a8c0@ook
Список
Дерево обсуждения
OFFSET and LIMIT - performance "Jan Bilek" <bilekj@gmail.com>
Re: OFFSET and LIMIT - performance Tom Lane <tgl@sss.pgh.pa.us>
Re: OFFSET and LIMIT - performance David Wall <d.wall@computer.org>
Re: OFFSET and LIMIT - performance "Simon Riggs" <simon@2ndquadrant.com>
Re: OFFSET and LIMIT - performance Kaloyan Iliev <kaloyan@digsys.bg>
Hello,
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?
Does the LIMIT statement do anything else then browsing/filtering rows with cursor (= the same thing i'd do in Java)?
How are the selected rows processed in select queries? Does PG select all rows and then filter them using statements like LIMIT and OFFSET or applies the statements while processing query?
 
Thanks for your analyzes!
 
JB
В списке pgsql-general по дате отправления
От: Michael Glaesemann
Дата:
От: Björn Lundin
Дата:
FAQ