You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I had a problem with a more complex query not picking the right index (for another report..). I thought I would try the cascades planner for debugging purposes, but noticed it was actually much worse. I've isolated it to a poor cost decision.
Consider the following test case:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id BIGINT NOT NULL PRIMARY KEY auto_increment,
b BIGINT NOT NULL,
pad VARBINARY(255),
INDEX (b)
);
INSERT INTO t1 SELECT NULL, 1, RANDOM_BYTES(255) FROM dual;
INSERT INTO t1 SELECT NULL, 1, RANDOM_BYTES(255) FROM t1 a INNER JOIN t1 b INNER JOIN t1 c LIMIT 10000;
INSERT INTO t1 SELECT NULL, 1, RANDOM_BYTES(255) FROM t1 a INNER JOIN t1 b INNER JOIN t1 c LIMIT 10000;
INSERT INTO t1 SELECT NULL, 1, RANDOM_BYTES(255) FROM t1 a INNER JOIN t1 b INNER JOIN t1 c LIMIT 10000;
INSERT INTO t1 SELECT NULL, 1, RANDOM_BYTES(255) FROM t1 a INNER JOIN t1 b INNER JOIN t1 c LIMIT 10000;
INSERT INTO t1 SELECT NULL, 1, RANDOM_BYTES(255) FROM t1 a INNER JOIN t1 b INNER JOIN t1 c LIMIT 10000;
UPDATE t1 SET b=id;
SELECT SLEEP(5);
ANALYZE TABLE t1;
SET tidb_enable_cascades_planner=0;
EXPLAIN ANALYZE SELECT * FROM t1 WHERE b < 5;
SET tidb_enable_cascades_planner=1;
EXPLAIN ANALYZE SELECT * FROM t1 WHERE b < 5;
(The sleep call is due to a different bug: #16570 )
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I had a problem with a more complex query not picking the right index (for another report..). I thought I would try the cascades planner for debugging purposes, but noticed it was actually much worse. I've isolated it to a poor cost decision.
Consider the following test case:
(The sleep call is due to a different bug: #16570 )
2. What did you expect to see?
This is the non-cascades planner:
3. What did you see instead?
With the cascades planner:
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)The text was updated successfully, but these errors were encountered: