{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/docs/issues/3743","repository_url":"https://api.github.com/repos/cockroachdb/docs","labels_url":"https://api.github.com/repos/cockroachdb/docs/issues/3743/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/docs/issues/3743/comments","events_url":"https://api.github.com/repos/cockroachdb/docs/issues/3743/events","html_url":"https://github.com/cockroachdb/docs/issues/3743","id":359995796,"node_id":"MDU6SXNzdWUzNTk5OTU3OTY=","number":3743,"title":"Make client-side pagination a true recommendation ","user":{"login":"awoods187","id":22278911,"node_id":"MDQ6VXNlcjIyMjc4OTEx","avatar_url":"https://avatars1.githubusercontent.com/u/22278911?v=4","gravatar_id":"","url":"https://api.github.com/users/awoods187","html_url":"https://github.com/awoods187","followers_url":"https://api.github.com/users/awoods187/followers","following_url":"https://api.github.com/users/awoods187/following{/other_user}","gists_url":"https://api.github.com/users/awoods187/gists{/gist_id}","starred_url":"https://api.github.com/users/awoods187/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awoods187/subscriptions","organizations_url":"https://api.github.com/users/awoods187/orgs","repos_url":"https://api.github.com/users/awoods187/repos","events_url":"https://api.github.com/users/awoods187/events{/privacy}","received_events_url":"https://api.github.com/users/awoods187/received_events","type":"User","site_admin":false},"labels":[{"id":809237085,"node_id":"MDU6TGFiZWw4MDkyMzcwODU=","url":"https://api.github.com/repos/cockroachdb/docs/labels/docs-project","name":"docs-project","color":"ca13d3","default":false}],"state":"open","locked":false,"assignee":{"login":"lhirata","id":15386648,"node_id":"MDQ6VXNlcjE1Mzg2NjQ4","avatar_url":"https://avatars0.githubusercontent.com/u/15386648?v=4","gravatar_id":"","url":"https://api.github.com/users/lhirata","html_url":"https://github.com/lhirata","followers_url":"https://api.github.com/users/lhirata/followers","following_url":"https://api.github.com/users/lhirata/following{/other_user}","gists_url":"https://api.github.com/users/lhirata/gists{/gist_id}","starred_url":"https://api.github.com/users/lhirata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhirata/subscriptions","organizations_url":"https://api.github.com/users/lhirata/orgs","repos_url":"https://api.github.com/users/lhirata/repos","events_url":"https://api.github.com/users/lhirata/events{/privacy}","received_events_url":"https://api.github.com/users/lhirata/received_events","type":"User","site_admin":false},"assignees":[{"login":"lhirata","id":15386648,"node_id":"MDQ6VXNlcjE1Mzg2NjQ4","avatar_url":"https://avatars0.githubusercontent.com/u/15386648?v=4","gravatar_id":"","url":"https://api.github.com/users/lhirata","html_url":"https://github.com/lhirata","followers_url":"https://api.github.com/users/lhirata/followers","following_url":"https://api.github.com/users/lhirata/following{/other_user}","gists_url":"https://api.github.com/users/lhirata/gists{/gist_id}","starred_url":"https://api.github.com/users/lhirata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhirata/subscriptions","organizations_url":"https://api.github.com/users/lhirata/orgs","repos_url":"https://api.github.com/users/lhirata/repos","events_url":"https://api.github.com/users/lhirata/events{/privacy}","received_events_url":"https://api.github.com/users/lhirata/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/cockroachdb/docs/milestones/8","html_url":"https://github.com/cockroachdb/docs/milestone/8","labels_url":"https://api.github.com/repos/cockroachdb/docs/milestones/8/labels","id":2684780,"node_id":"MDk6TWlsZXN0b25lMjY4NDc4MA==","number":8,"title":"2.1","description":"","creator":{"login":"jseldess","id":15893490,"node_id":"MDQ6VXNlcjE1ODkzNDkw","avatar_url":"https://avatars2.githubusercontent.com/u/15893490?v=4","gravatar_id":"","url":"https://api.github.com/users/jseldess","html_url":"https://github.com/jseldess","followers_url":"https://api.github.com/users/jseldess/followers","following_url":"https://api.github.com/users/jseldess/following{/other_user}","gists_url":"https://api.github.com/users/jseldess/gists{/gist_id}","starred_url":"https://api.github.com/users/jseldess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseldess/subscriptions","organizations_url":"https://api.github.com/users/jseldess/orgs","repos_url":"https://api.github.com/users/jseldess/repos","events_url":"https://api.github.com/users/jseldess/events{/privacy}","received_events_url":"https://api.github.com/users/jseldess/received_events","type":"User","site_admin":false},"open_issues":260,"closed_issues":234,"state":"open","created_at":"2017-08-07T09:35:34Z","updated_at":"2018-09-18T19:53:00Z","due_on":"2018-10-01T07:00:00Z","closed_at":null},"comments":5,"created_at":"2018-09-13T17:40:25Z","updated_at":"2018-09-18T20:49:03Z","closed_at":null,"author_association":"NONE","body":"I heard from k yesterday that they thought pagination via offset/limit was slow and were looking for recommendations on what to do for large result sets.\r\n\r\nI spoke with @jordanlewis and he recommended:\r\n\"Doing “client-side pagination” by retrieving a set of records with a limit, and then checking the index key of the last row, using that as an index constraint, and then running the query again\r\nthis is normal - not specific to cockroach\"\r\n\r\nOur current docs: https://www.cockroachlabs.com/docs/stable/selection-queries.html#limiting-row-count-and-pagination actually suggest the wrong solution for pagination.\r\n\r\nThe reason is that \"offset doesn’t know anything smart - it has to get the same data as before, just skips the first n. You have to participate as a client by remembering the index key of the last result set you saw.\"\r\n\r\nWe should also reference that some databases offer a feature called cursors to do this. @andy-kimball mentioned that \"cursors are generally not a great architecture as well b/c they force server to keep state. client side is way to go for pagination. server pagination just doesn't scale well\"\r\n\r\nJordan also mentioned that \"you run into trouble with a scale out system like cockroach - if your load balancer moves you to a different server for example the cursor will be lost\"\r\n\r\nAndy also mentioned that \"sql server has cursors, and we spent a lot of time recommending customers not use them\"\r\n\r\nThis way we can make it clear that client-side is the way to go and its not just because we don't have cursors. \r\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/docs/issues/comments/422548965","html_url":"https://github.com/cockroachdb/docs/issues/3743#issuecomment-422548965","issue_url":"https://api.github.com/repos/cockroachdb/docs/issues/3743","id":422548965,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjU0ODk2NQ==","user":{"login":"wzrdtales","id":1786821,"node_id":"MDQ6VXNlcjE3ODY4MjE=","avatar_url":"https://avatars1.githubusercontent.com/u/1786821?v=4","gravatar_id":"","url":"https://api.github.com/users/wzrdtales","html_url":"https://github.com/wzrdtales","followers_url":"https://api.github.com/users/wzrdtales/followers","following_url":"https://api.github.com/users/wzrdtales/following{/other_user}","gists_url":"https://api.github.com/users/wzrdtales/gists{/gist_id}","starred_url":"https://api.github.com/users/wzrdtales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzrdtales/subscriptions","organizations_url":"https://api.github.com/users/wzrdtales/orgs","repos_url":"https://api.github.com/users/wzrdtales/repos","events_url":"https://api.github.com/users/wzrdtales/events{/privacy}","received_events_url":"https://api.github.com/users/wzrdtales/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T20:49:03Z","updated_at":"2018-09-18T20:49:03Z","author_association":"NONE","body":"@jordanlewis Nope, they are ordered, but not, well ordered in the order they're created."}}
{"actor":{"display_login":"wzrdtales"}}