Implement keyset/cursor pagination for users list page #1207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Offset pagination creates O(n) load on MySQL as page depth increases. Keyset pagination uses indexed columns for O(1) performance regardless of page position.
Changes
KeysetPaginationcomponent - Cursor encoding/decoding (base64 JSON), URL generation for prev/next navigationKeysetDataProvider- ReplacesActiveDataProvider, uses WHERE conditions on indexed columns instead of OFFSETUserController::actionIndex()- UsesKeysetDataProviderwithrankas primary key columnviews/user/index.php- Manual table rendering with prev/next pagination linksHow it works
Instead of:
Uses:
Cursor contains encoded
{key, id}tuple for tie-breaking on non-unique sort columns.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
github.com (HTTP Only)/usr/bin/ssh /usr/bin/ssh -o SendEnv=GIT_PROTOCOL git@github.com git-upload-pack 'jquery/jquery-dist.git'(packet block)/usr/bin/ssh /usr/bin/ssh -o SendEnv=GIT_PROTOCOL git@github.com git-upload-pack 'RobinHerbots/Inputmask.git'(packet block)/usr/bin/ssh /usr/bin/ssh -o SendEnv=GIT_PROTOCOL git@github.com git-upload-pack 'twbs/bootstrap.git'(packet block)https://api.github.com/repos/cebe/markdown/zipball/8efb4268c90add2eee0edacf503ae71f22ccc745/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)https://api.github.com/repos/ezyang/htmlpurifier/zipball/b287d2a16aceffbf6e0295559b39662612b77fcf/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)https://api.github.com/repos/jquery/jquery-dist/zipball/c0185ab7c75aab88762c5aae780b9d83b80eda72/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/o8QfYI /usr/bin/composer install(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)https://api.github.com/repos/mathiasbynens/punycode.js/zipball/0fbadd6e81f3a0ce06c38998040d6db6bdfbc5c9/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)https://api.github.com/repos/yiisoft/jquery-pjax/zipball/a9298d57da63d14a950f1b94366a864bc62264fb/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)https://api.github.com/repos/yiisoft/yii2-composer/zipball/b684b01ecb119c8287721def726a0e24fec2fef2/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/FnhPet /usr/bin/composer install --no-dev --no-progress(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.