{"action":"created","issue":{"url":"https://api.github.com/repos/pingcap/tidb/issues/4686","repository_url":"https://api.github.com/repos/pingcap/tidb","labels_url":"https://api.github.com/repos/pingcap/tidb/issues/4686/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/4686/comments","events_url":"https://api.github.com/repos/pingcap/tidb/issues/4686/events","html_url":"https://github.com/pingcap/tidb/issues/4686","id":261552018,"number":4686,"title":"IN Operator on primary key causes full table scan?","user":{"login":"Darren","id":12817,"avatar_url":"https://avatars2.githubusercontent.com/u/12817?v=4","gravatar_id":"","url":"https://api.github.com/users/Darren","html_url":"https://github.com/Darren","followers_url":"https://api.github.com/users/Darren/followers","following_url":"https://api.github.com/users/Darren/following{/other_user}","gists_url":"https://api.github.com/users/Darren/gists{/gist_id}","starred_url":"https://api.github.com/users/Darren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Darren/subscriptions","organizations_url":"https://api.github.com/users/Darren/orgs","repos_url":"https://api.github.com/users/Darren/repos","events_url":"https://api.github.com/users/Darren/events{/privacy}","received_events_url":"https://api.github.com/users/Darren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-29T07:17:44Z","updated_at":"2017-09-29T07:20:25Z","closed_at":null,"author_association":"NONE","body":"We found that IN operations on TiDB is very slow. Is this a problem with the optimizer?\r\n\r\nhere's the output of explain:\r\n\r\n```sql\r\ncreate table t2  (id int, primary key(id));\r\ninsert into t2 values (1),(2),(3);\r\n\r\nexplain select * from t2 where id in (1,2);\r\n\r\n+---------------+---------+----------+------+------------------------------------------------+-------+\r\n| id            | parents | children | task | operator info                                  | count |\r\n+---------------+---------+----------+------+------------------------------------------------+-------+\r\n| TableScan_4   |         |          | cop  | table:t2, range:[1,1], [2,2], keep order:false | 0.006 |\r\n| TableReader_5 |         |          | root | data:TableScan_4                               | 0.006 |\r\n+---------------+---------+----------+------+------------------------------------------------+-------+\r\n\r\n```\r\n\r\nRelease Version: 0.8.0\r\nGit Commit Hash: 46c1a0e3c37b6026c68029fe18873ea086697fed\r\nGit Branch: HEAD\r\nUTC Build Time: 2017-09-27 03:11:49\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pingcap/tidb/issues/comments/333051043","html_url":"https://github.com/pingcap/tidb/issues/4686#issuecomment-333051043","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/4686","id":333051043,"user":{"login":"shenli","id":1192573,"avatar_url":"https://avatars0.githubusercontent.com/u/1192573?v=4","gravatar_id":"","url":"https://api.github.com/users/shenli","html_url":"https://github.com/shenli","followers_url":"https://api.github.com/users/shenli/followers","following_url":"https://api.github.com/users/shenli/following{/other_user}","gists_url":"https://api.github.com/users/shenli/gists{/gist_id}","starred_url":"https://api.github.com/users/shenli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shenli/subscriptions","organizations_url":"https://api.github.com/users/shenli/orgs","repos_url":"https://api.github.com/users/shenli/repos","events_url":"https://api.github.com/users/shenli/events{/privacy}","received_events_url":"https://api.github.com/users/shenli/received_events","type":"User","site_admin":false},"created_at":"2017-09-29T07:20:25Z","updated_at":"2017-09-29T07:20:25Z","author_association":"OWNER","body":"@Darren The table size is too small, it is better to scan table in this case.\r\nYou can insert more data and run `analyze table t2;`. Then try it again."}}
{"actor":{"display_login":"shenli"}}