Which one is better?# Database - 数据库
B*g
1 楼
why CHOOSECost for (1) is more than (2)?
SELECT *
FROM c
WHERE EXISTS (SELECT 1
FROM a
WHERE a.key = c.key
AND ROWNUM = 1)
Plan
SELECT STATEMENT CHOOSECost: 670,429 Bytes: 87,120,580 Cardinality: 215,
645
4 FILTER
1 TABLE ACCESS FULL C Cost: 23,494 Bytes: 87,120,580 Cardinality:
215,645
3 COUNT STOPKEY
2 INDEX RANGE SCAN UNIQUE INDEX1(***table A***) Cost: 3 B
SELECT *
FROM c
WHERE EXISTS (SELECT 1
FROM a
WHERE a.key = c.key
AND ROWNUM = 1)
Plan
SELECT STATEMENT CHOOSECost: 670,429 Bytes: 87,120,580 Cardinality: 215,
645
4 FILTER
1 TABLE ACCESS FULL C Cost: 23,494 Bytes: 87,120,580 Cardinality:
215,645
3 COUNT STOPKEY
2 INDEX RANGE SCAN UNIQUE INDEX1(***table A***) Cost: 3 B