| От | PFC |
|---|---|
| Тема | Re: [SQL] OFFSET impact on Performance??? |
| Дата | |
| Msg-id | opsk89szusth1vuj@musicbox обсуждение исходный текст |
| Ответ на | Re: [SQL] OFFSET impact on Performance??? (Alex Turner <armtuk@gmail.com>) |
| Ответы |
Re: [SQL] OFFSET impact on Performance???
|
| Список | pgsql-performance |
> Thats a really good idea, just store a list of the sorted ids in the
> temp table - small amount of data for insert... I like it!
>
> Alex Turner
> NetEconomist
The best part is that you can skip the LIMIT/OFFSET entirely if you put
page numbers in your cache table while inserting into it, via a temporary
sequence or something. Retrieving the results will then be very fast, but
beware that SELECT * FROM table WHERE id =ANY( array ) won't use an index,
so you'll have to trick the thing by generating a query with IN, or
joining against a SRF returning the elements of the array one by one,
which might be better.
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера