Re: Determining offsets to jump to grab a group of records
В списке pgsql-general по дате отправления:
| От | David Lambert |
|---|---|
| Тема | Re: Determining offsets to jump to grab a group of records |
| Дата | |
| Msg-id | g2reh2$2b7v$1@news.hub.org обсуждение |
| Ответ на | Re: Determining offsets to jump to grab a group of records ("Scott Marlowe" <scott.marlowe@gmail.com>) |
| Список | pgsql-general |
Scott Marlowe wrote: > Yes there is. Use an indexed id field of some kind. > > select * from table where idfield between 0 and 100; > select * from table where idfield between 1000000 and 1000100; > > Will both be equally fast. Offset / limit syntax requires the db to > materialize <offset>+<limit> rows for the query. between and an id > does not. An ID would work fine if you could always guarantee that you were ordering by the id. If not then the ID fields would be in non sequential order which would throw off the between above and give you incorrect data. We need something that would be independent from the ordering that way a user could order it by first name, last name, brother's wife's maiden name, etc. and it would still work correctly. Are there any other ways to accomplish this? Thanks. David Lambert
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера