DEV Community

Discussion on: The SQL I Love. Efficient pagination of a table with 100M records

alexatkinson profile image
Alex Atkinson

Depending on whether or not your ux SLAs will permit it, you can pre-gen all your pagination ranges and store them in a cache. If your ux can handle a 10s delay from post to publish, that gives a 10000ms temporal window in which a large portion of a pagination query can be cached. Cache each size of list display. Ex: Show: 100, 250, 500 items.