Nested queries V/S Joins
Posted in 1996
Rajesh N. Malhotra — — source: Informix-list mailing list archive (1991-1998)
Informix Gurus,
What is more efficient nested subqueries or joins?
Query 1:
select item from a, b
where a.item = b.item and
b.num = 50;
Query 2:
select item from a
where item in (select item from b where b.num = 50);
If I "set explain on" on the above two queries, Query 1 has a higher
estimated cost than Query 2, but the execution times (reported by time)
are less for Query 1.
What does the "estimated cost of a query" mean anyway?
Any and all help on this matter appreciated.
Thanx,
Raj.