Answer the question
In order to leave comments, you need to log in
How to select the next 100 rows from a large table?
There are two related tables. I make a selection:
SELECT * FROM video INNER JOIN recording ON video.\"recordingId\" = recording.id LIMIT 100;
Answer the question
In order to leave comments, you need to log in
1) SELECT ... LIMIT 100 OFFSET
300 the database will have to read all the million rows and sort them. If it's not critical, then it's not worth it.
3) How is it?
Presentation from one of the conferences (PGDay) https://pgday.ru/presentation/232/5964945ea4142.pdf , look, starting from page 14, there are more complicated methods, but they will provide good speed, unlike OFFSET.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question