I
I
impressive172021-03-23 14:27:36
PostgreSQL
impressive17, 2021-03-23 14:27:36

What index to make for a query with offsetOM in Postgres?

There is a rather big table (5-10 records). It receives a lot of requests with offsetOM. Tell me, what are the best practices, how to speed up such a request? Maybe there is a special index for such queries, which is customary to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2021-03-23
@melkij

Do not make large offset.
If you really want to, and the load profile and queries allow, then take the unique row identifier into the index-only scan, followed by the reading of the remaining fields.
For example, https://pgday.ru/ru/2017/papers/232 from slide 14

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question