-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
sig/plannerSIG: PlannerSIG: Plannertype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
SELECT
tab.id AS id
FROM
t1 AS tab
WHERE 1 = 1 OR
(EXISTS(SELECT 1 FROM t2 WHERE table_id = tab.id))
+---------------------------------+------------+---------------+-----------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| id | estRows | estCost | task | access object | operator info |
+---------------------------------+------------+---------------+-----------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| Projection_8 | 6071792.00 | 868583556.41 | root | | test.t1.id |
| └─Selection_9 | 6071792.00 | 867977591.57 | root | | or(1, Column#68) |
| └─HashJoin_10 | 7589740.00 | 489249565.57 | root | | left outer semi join, equal:[eq(test.t1.id, test.t2.tableid)] |
| ├─IndexReader_26(Build) | 1385922.00 | 33841325.91 | root | | index:IndexFullScan_25 |
| │ └─IndexFullScan_25 | 1385922.00 | 392860557.71 | cop[tikv] | table:t2, index:PRIMARY(accountid, metastoreid, tableid, principal, privilege) | keep order:false |
| └─IndexReader_16(Probe) | 7589740.00 | 159804590.85 | root | | index:IndexFullScan_15 |
| └─IndexFullScan_15 | 7589740.00 | 1768611067.74 | cop[tikv] | table:tab, index:securable_id_deleted_at_index(purgestate, deletedat, id) | keep order:false |
+---------------------------------+------------+---------------+-----------+----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
2. What did you expect to see? (Required)
short-circuit should be applied, table t2 no need to show up
3. What did you see instead (Required)
short-circuit was not applied, table t2 showed up
4. What is your TiDB version? (Required)
current master.
Metadata
Metadata
Assignees
Labels
sig/plannerSIG: PlannerSIG: Plannertype/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.