mislav/will_paginate

Support for two queries pagination: first paginate only `id` field and then select records by ids

leschenko opened this issue · 1 comments

For pagination in large tables with many columns sometimes we can get better performance with two queries pagination:

  1. paginate only with id column
SELECT `products`.id FROM `products` LIMIT 30 OFFSET 30
  1. select records by ids
SELECT `products`.* FROM `products` WHERE `products`.`id` IN (1, 2, 3, 4, 5)

It will be nice to have something like large option in paginate method for two queries pagination.