{"action":"created","issue":{"url":"https://api.github.com/repos/bakerz/quickLearn/issues/7","labels_url":"https://api.github.com/repos/bakerz/quickLearn/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/bakerz/quickLearn/issues/7/comments","events_url":"https://api.github.com/repos/bakerz/quickLearn/issues/7/events","html_url":"https://github.com/bakerz/quickLearn/issues/7","id":103844034,"number":7,"title":"分页","user":{"login":"bakerz","id":5406343,"avatar_url":"https://avatars.githubusercontent.com/u/5406343?v=3","gravatar_id":"","url":"https://api.github.com/users/bakerz","html_url":"https://github.com/bakerz","followers_url":"https://api.github.com/users/bakerz/followers","following_url":"https://api.github.com/users/bakerz/following{/other_user}","gists_url":"https://api.github.com/users/bakerz/gists{/gist_id}","starred_url":"https://api.github.com/users/bakerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakerz/subscriptions","organizations_url":"https://api.github.com/users/bakerz/orgs","repos_url":"https://api.github.com/users/bakerz/repos","events_url":"https://api.github.com/users/bakerz/events{/privacy}","received_events_url":"https://api.github.com/users/bakerz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-29T10:46:10Z","updated_at":"2015-09-01T08:51:46Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/bakerz/quickLearn/issues/comments/136639163","html_url":"https://github.com/bakerz/quickLearn/issues/7#issuecomment-136639163","issue_url":"https://api.github.com/repos/bakerz/quickLearn/issues/7","id":136639163,"user":{"login":"bakerz","id":5406343,"avatar_url":"https://avatars.githubusercontent.com/u/5406343?v=3","gravatar_id":"","url":"https://api.github.com/users/bakerz","html_url":"https://github.com/bakerz","followers_url":"https://api.github.com/users/bakerz/followers","following_url":"https://api.github.com/users/bakerz/following{/other_user}","gists_url":"https://api.github.com/users/bakerz/gists{/gist_id}","starred_url":"https://api.github.com/users/bakerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakerz/subscriptions","organizations_url":"https://api.github.com/users/bakerz/orgs","repos_url":"https://api.github.com/users/bakerz/repos","events_url":"https://api.github.com/users/bakerz/events{/privacy}","received_events_url":"https://api.github.com/users/bakerz/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T08:51:46Z","updated_at":"2015-09-01T08:51:46Z","body":"如果你是想取“下一页”或者“上一页”，可以通过查询大于某个_id的sort+limit来实现。\r\n如果你是想取“第xxx页”，如果想要完全精确，其实没有多好的办法，分页本身是“挨个数”的逻辑，有没有索引都避免不了这个耗时的过程。\r\n在分页数非常大的情况下，排在几千万之后的数字并没有多少人关心，你可以使用redis做页数对_id列表的缓存，每隔一段时间更新一次。\r\n这个问题的根本点在于：“索引所依赖的b+结构不能用于排名计算”。"}}