Hi All,
Could someone please explain the reason why I would get different results from the following queries. In particular, what could cause the results in the equi-join to be higher?
Would really appreciate your help.
---
Application Sub-query
Select Count(*)
From TABLE_A
Where (TABLE_A.KEY IN
(SELECT KEY FROM TABLE_B))
3.2m
ODBC equivalent Sub-query
SELECT Count(TABLE_A.key) AS Cnt
FROM TABLE_A
WHERE TABLE_A.key IN
(SELECT TABLE_B.KEY FROM TABLE_B);
3.7m
ODBC equi-join
SELECT Count(TABLE_A.key) AS Cnt
FROM TABLE_A INNER JOIN TABLE_B
ON TABLE_A.key = TABLE_B.key;
6.6m
Could someone please explain the reason why I would get different results from the following queries. In particular, what could cause the results in the equi-join to be higher?
Would really appreciate your help.
---
Application Sub-query
Select Count(*)
From TABLE_A
Where (TABLE_A.KEY IN
(SELECT KEY FROM TABLE_B))
3.2m
ODBC equivalent Sub-query
SELECT Count(TABLE_A.key) AS Cnt
FROM TABLE_A
WHERE TABLE_A.key IN
(SELECT TABLE_B.KEY FROM TABLE_B);
3.7m
ODBC equi-join
SELECT Count(TABLE_A.key) AS Cnt
FROM TABLE_A INNER JOIN TABLE_B
ON TABLE_A.key = TABLE_B.key;
6.6m