Neither is inheriently faster.  It all depends on how the DB server analyzes
and tries to optimize the query.  There is an entire sub-discipline of DBAs
that do nothing but optimize queries because its highly technical...how many
rows in which table, depending on the order they're accessed plus DB metrics
or indices that are kept....and so on.

However, for some "good enough" stuff, it generally works to figure out how
your DB attempts to optimize, then try to write the SQL to eliminate the
most rows of data first (BTW, this is why outer joins tend to be slower;
they usually do not pare down the data set as quickly).  The order that you
list the tables and which fields you use will have a huge impact on the
speed.

If you're working on SQL Server I can't help ya...if you're on Oracle 7,
drop me an email and I'll go into more depth from what I can remember.  On
Oracle 8, I'm not good enough to do anything but guess.  If you have a DBA
that you can ask, get them to tell you how to use EXPLAIN PLAN.

Brian

-----Original Message-----
From: Robert Everland [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 2:03 PM
To: CF-Talk
Subject: Faster Join


        What would be faster an inner join, an outer join, or a where
something = something join. I am working with huge queries and a little bit
of time on a small query could translate to a huge gain on my joins.

Robert Everland III
Web Developer
Dixon Ticonderoga
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to