以下哪个查询更有效,为什么?根据执行计划,它们的总成本相同,但我不确定仅此一项是否是整体性能的良好指标。
1>
SELECT MIN(ROWID), MAX(ROWID)
FROM tab_a
WHERE status = 0
AND EXISTS (
SELECT 'X'
FROM tab_b
WHERE status = 0
AND number = assembly_number
AND ROWID >= :min_rowid
AND ROWID <= :max_rowid
)
;
2>
SELECT MIN(ROWID), MAX(ROWID)
FROM tab_a
WHERE status = 0
AND assembly_number IN (
SELECT number
FROM tab_b
WHERE status = 0
AND ROWID >= :min_rowid
AND ROWID <= :max_rowid
)
;