Re: SELECT subquery much slower than IN ( list...)???
Posted in 1998
Topics: Performance & Tuning, SQL Development & Query Writing
David Williams wrote: <snip> > Look just do a proper join, such subqueries are really just a join > anyway. I suspect the optimizer is just crap at subqueries.. > I did a "proper" join, and it took about 40 seconds (compared to 3s for a literal list, and 10 minutes for the subquery). If it is true that subquery is just a join it may explain why it was slower than an "IN (literal set)" clause, since maybe the optimizer is not doing a "proper" join, though I don't see where it could go that far wrong on such a simple query. But this next statement by <dkosenko@monmouth.com> disagrees with a subquery being the same as a join: > >The subquery as written is functionally the same as a literal > >set. So I don't know what to believe. I think it is a bug, myself. I should probably just call Informix and report it. -- Matt Reprogle IS Engineer, Delphi Delco Electronics Systems phone:(765)451-9651 FAX: (765)451-8230 mcreprog@ictest.delcoelect.com