Please answer these questions before submitting your issue. Thanks!
CREATE TABLE `t8` (
`a` int,
`b` int,
`c` int,
`d` int,
`e` int,
`f` int,
`g` int,
`h` int,
`i` int,
`j` int,
`k` int,
`l` int,
`m` int,
`n` int,
`o` int,
`p` int,
`q` int,
`r` int,
`s` int,
`t` int,
`u` int,
`v` int,
`w` int,
`x` int,
`y` int,
`z` int,
`aa` int,
`ab` int,
`ac` int,
`ad` int,
`ae` int,
`af` int,
`ag` int,
`ah` int,
`ai` int,
`aj` int,
`ak` int,
`al` int,
`am` int,
`an` int,
`ao` int,
`ap` int,
`aq` int,
`ar` int,
`as` int,
`at` int,
`au` int,
`av` int,
`aw` int,
`ax` int,
`ay` int,
`az` int,
`ba` int,
`bb` int,
`bc` int,
`bd` int,
`be` int,
`bf` int,
`bg` int,
`bh` int,
`bi` int,
`bj` int,
`bk` int,
`bl` int,
`bm` int,
`bn` int,
`bo` int,
`bp` int,
`bq` int,
`br` int,
`bs` int,
`bt` int,
`bu` int,
`bv` int,
`bw` int,
`bx` int,
`by` int,
`bz` int,
`ca` int,
`cb` int,
`cc` int,
`cd` int,
`ce` int,
`cf` int,
`cg` int,
`ch` int,
`ci` int,
`cj` int,
`ck` int,
`cl` int,
`cm` int,
`cn` int,
`co` int,
`cp` int,
`cq` int,
`cr` int,
`cs` int,
`ct` int,
`cu` int,
`cv` int,
`cw` int,
`cx` int,
`cy` int,
`cz` int,
`da` int,
`db` int,
`dc` int,
`dd` int,
`de` int,
`df` int,
`dg` int,
`dh` int,
`di` int,
`dj` int,
`dk` int,
`dl` int,
`dm` int,
`dn` int,
`do` int,
`dp` int,
`dq` int,
`dr` int,
`ds` int,
`dt` int,
`du` int,
`dv` int,
`dw` int,
`dx` int,
`dy` int,
`dz` int,
`ea` int,
`eb` int,
`ec` int,
`ed` int,
`ee` int,
`ef` int,
`eg` int,
`eh` int,
`ei` int,
`ej` int,
`ek` int,
`el` int,
`em` int,
`en` int,
`eo` int,
`ep` int,
`eq` int,
`er` int,
`es` int,
`et` int,
`eu` int,
`ev` int,
`ew` int,
`ex` int,
`ey` int,
`ez` int,
KEY `ia` (`aa`),
KEY `iab` (`aa`, `b`),
KEY `iac` (`a`, `c`),
KEY `iad` (`aa`, `d`),
KEY `iae` (`a`, `e`),
KEY `iaf` (`a`, `f`),
KEY `iabc` (`ea`, `b`, `c`),
KEY `iabd` (`ea`, `b`, `d`),
KEY `iabe` (`ea`, `b`, `e`),
KEY `iabf` (`ea`, `b`, `f`),
KEY `iacb` (`ea`, `c`, `b`),
KEY `iacd` (`ea`, `c`, `d`),
KEY `iace` (`ea`, `c`, `e`),
KEY `iacf` (`ea`, `c`, `f`),
KEY `iade` (`ea`, `d`, `e`),
KEY `iadf` (`ea`, `d`, `f`),
KEY `iaeb` (`ea`, `e`, `b`),
KEY `iaec` (`ea`, `e`, `c`),
KEY `iaed` (`ea`, `e`, `d`),
KEY `iaef` (`ea`, `e`, `f`),
KEY `iafb` (`a`, `f`, `b`),
KEY `iafc` (`ea`, `f`, `a`),
KEY `iafd` (`ea`, `f`, `d`),
KEY `iafe` (`ea`, `f`, `e`),
KEY `iabcd` (`a`, `b`, `c`, `ed`),
KEY `iabce` (`a`, `b`, `c`, `ee`),
KEY `iabcf` (`a`, `b`, `c`, `ef`),
KEY `iabdc` (`a`, `b`, `d`, `ec`),
KEY `iabfc` (`a`, `b`, `f`, `ec`),
KEY `iabfd` (`a`, `b`, `f`, `ed`),
KEY `iabfe` (`a`, `b`, `f`, `ee`),
KEY `iacbd` (`a`, `c`, `b`, `ed`),
KEY `iacbe` (`a`, `c`, `b`, `ee`),
KEY `iacbf` (`a`, `c`, `b`, `ef`),
KEY `iacdb` (`a`, `c`, `d`, `eb`),
KEY `iacde` (`a`, `c`, `d`, `ee`),
KEY `iadbe` (`a`, `d`, `b`, `ee`),
KEY `iadcb` (`a`, `d`, `c`, `eb`),
KEY `iadcf` (`a`, `d`, `c`, `ef`),
KEY `ib` (`eb`),
KEY `iba` (`eb`, `a`),
KEY `ibc` (`eb`, `c`),
KEY `ibd` (`eb`, `d`),
KEY `ibe` (`eb`, `e`),
KEY `ibf` (`eb`, `f`),
KEY `ibac` (`b`, `a`, `c`),
KEY `ibad` (`b`, `a`, `d`),
KEY `ibae` (`b`, `a`, `e`),
KEY `ibaf` (`b`, `a`, `f`),
KEY `ibca` (`b`, `c`, `a`),
KEY `ibcd` (`b`, `c`, `d`),
KEY `ibce` (`b`, `c`, `e`),
KEY `ibcf` (`b`, `c`, `f`),
KEY `ibda` (`b`, `d`, `a`),
KEY `ibdc` (`b`, `d`, `c`),
KEY `ibde` (`b`, `d`, `e`),
KEY `ibdf` (`b`, `d`, `f`),
KEY `ibea` (`b`, `e`, `a`),
KEY `ibec` (`b`, `e`, `c`),
KEY `ibfa` (`b`, `f`, `a`),
KEY `ibfc` (`b`, `f`, `c`),
KEY `ibfd` (`b`, `f`, `d`),
KEY `ibfe` (`b`, `f`, `e`)
);
This is optimistic - but when I specify "use index" - I can force one index to be considered, and the explain is fast:
master branch - but true in any release.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
This is optimistic - but when I specify "use index" - I can force one index to be considered, and the explain is fast:
3. What did you see instead (Required)
Allowing the optimizer to consider all indexes in 8X slower for the above DDL:
4. What is your TiDB version? (Required)
master branch - but true in any release.