Abhishek Yadav
ரூபீ ப்ரோக்ராமர்
Co-organizer: Chennai.rb
TODO: Add ref to twitter discussion
-- First page
SELECT * FROM comments OFFSET 0 LIMIT 10 ORDER BY created_at
-- Second page
SELECT * FROM comments OFFSET 10 LIMIT 10 ORDER BY created_at
# nth page
run_sql("SELECT * FROM comments OFFSET " + (n-1)*10 + "LIMIT 10")
Postgresql | √ |
Mysql | √ |
Oracle | No |
SQLServer | No |
Fake |
Abhishek |
Page-1
Page-2
User1: Show page-1
User2: Remove Fake
User1: Show page-2
users table
Fake |
Abhishek |
Page-1
Page-2
User1: Show page-1
User2: Remove Fake
User1: Show page-2
users table
Fake |
Abhishek |
Page-1
Page-2
User1: Show page-1
User2: Remove Fake
User1: Show page-2
Abhishek moves to page-1
users table
User1: Show page-1
Abhishek |
Page-1
Page-2
User2: Remove Fake
User1: Show page-2
User1 missed Abhishek !
users table
-- Last page in a million record table
SELECT * FROM comments OFFSET 999990 LIMIT 10 ORDER BY created_at
-- TODO: Add time taken
TODO: add example