What if you do this?
SELECT * FROM table_name ORDER BY id LIMIT 10 OFFSET 8000001;
With PostgreSQL it will use the index to get your offset, no table scan needed.
It works for any b-tree based indexed column. So if you had an index on a column called first_name, you can do:
SELECT * FROM table_name ORDER BY first_name LIMIT 10 OFFSET 8000001;
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What if you do this?
With PostgreSQL it will use the index to get your offset, no table scan needed.
It works for any b-tree based indexed column. So if you had an index on a column called first_name, you can do: