Avoid OFFSET when possible
vhf opened this issue · 3 comments
vhf commented
(Following up on #20 )
Detecting if there's an order_by
and using a combination of WHERE pk > :last_id
and LIMIT :page_size
seems like a good approach.
What do you think?
drewolson commented
@vhf this only works if the schema is using an integer-based, ascending primary id. It wouldn't work for applications using, say, UUIDs as identifiers. I think cursor-based pagination is a great approach, but I think it should live in a separate, specific repo that implements the Scrivener.Paginator
protocol with this new technique.
joshuataylor commented
@drewolson - Do you think this should be a separate module, or included within scrivener_ecto?
I'm interested in helping with this, and would be happy to contribute back code for this.
drewolson commented
Because these changes will effectively be backwards incompatible, I'd like
them to be in a separate module. I will happily link to it from the
scrivener readme if it turns out well.
…On Sun, May 14, 2017 at 8:31 AM Josh Taylor ***@***.***> wrote:
@drewolson <https://github.com/drewolson> - Do you think this should be a
separate module, or included within scrivener_ecto?
I'm interested in helping with this, and would be happy to contribute back
code for this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAN0Cv-xpPcL0eCCsjaEzRlNi7-XXk2ks5r5wISgaJpZM4M8_e4>
.