{"action":"closed","issue":{"url":"https://api.github.com/repos/leancloud/docs/issues/1469","repository_url":"https://api.github.com/repos/leancloud/docs","labels_url":"https://api.github.com/repos/leancloud/docs/issues/1469/labels{/name}","comments_url":"https://api.github.com/repos/leancloud/docs/issues/1469/comments","events_url":"https://api.github.com/repos/leancloud/docs/issues/1469/events","html_url":"https://github.com/leancloud/docs/issues/1469","id":172610379,"number":1469,"title":"整理一份关于查询性能的文档","user":{"login":"jysperm","id":1191561,"avatar_url":"https://avatars.githubusercontent.com/u/1191561?v=3","gravatar_id":"","url":"https://api.github.com/users/jysperm","html_url":"https://github.com/jysperm","followers_url":"https://api.github.com/users/jysperm/followers","following_url":"https://api.github.com/users/jysperm/following{/other_user}","gists_url":"https://api.github.com/users/jysperm/gists{/gist_id}","starred_url":"https://api.github.com/users/jysperm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jysperm/subscriptions","organizations_url":"https://api.github.com/users/jysperm/orgs","repos_url":"https://api.github.com/users/jysperm/repos","events_url":"https://api.github.com/users/jysperm/events{/privacy}","received_events_url":"https://api.github.com/users/jysperm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-23T04:33:39Z","updated_at":"2016-08-29T05:52:05Z","closed_at":"2016-08-29T05:52:05Z","body":"影响性能的查询：\r\n\r\n- 不等于和不包含查询（无法使用索引）\r\n- 通配符在前面的字符串查询（无法使用索引）\r\n- 有条件的 count（需要扫描所有数据）\r\n- 无索引的排序（另外除非复合索引同时覆盖了查询和排序，否则只有其中一个能使用索引）\r\n- 无索引的查询（另外除非复合索引同时覆盖了所有条件，否则未覆盖到的条件无法使用索引，如果未覆盖的条件区分度较低将会扫描较多的数据）\r\n- skip 跳过较多的行数（相当于需要先查出被跳过的那些行）\r\n\r\n数据量小没关系，主要是数据量比较大（10 万级别）才需要考虑。"}}
{"actor":{"display_login":"wujun4code"}}