Home » RDBMS Server » Server Administration » Re: Is JOIN a better choice over SUBQUERY ? Pl. expl.
Re: Is JOIN a better choice over SUBQUERY ? Pl. expl. [message #372062] Mon, 08 January 2001 14:22
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
Generally the join is preferable, but it depends on your query. The easiest way for you to decide in this example is to set "timing" on when you run the query. In SQL*Plus enter "set timing on". Also try "set autotrace on".

A good variation to try with the subquery is:

select path from volumetable where exists
(select 1 from objecttable where objectname='xxxx' and objecttype = 1);

This can eliminate unnecessary access of the table if the where clause can be satisfied by accessing the index alone.
Previous Topic: star schema to demormalized table
Next Topic: composite primary keys
Goto Forum:
  


Current Time: Sat May 18 02:39:25 CDT 2024