Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> partition elimination vs query hints

partition elimination vs query hints

From: Warren <warren.wang_at_csfb.com>
Date: 27 Oct 2004 14:46:05 -0700
Message-ID: <431d61.0410271346.1ff5de97@posting.google.com>


I have a set tables partitioned by dates. Could someone tell me which following query will get final result faster.

(A) using hints ( loop through all partitions within start/end date range )

   foreach partitions that covered in the 'start date/end date' range     select * from tableA partition (#1), tableB partition (#1).....     where tableA.date=tableB.date and

          tableB.date=tableC.date......
          and
          tableA.date between  'a start date' and 'a end date'
   
      ( note: the start and end date might beyond the range in the partiton.)
    end foreach.     
   

(B) using partition elimination (no loop)

  select * from tableA , tableB .....

     where tableA.date=tableB.date and
          tableB.date=tableC.date......
          and
          tableA.date between  'a start date' and 'a end date'


I guess the main difference is that if oracle finds out there are N number of partitions in all the tables need to fulfill the query. it eliminates the rest of paritions. So it will do

    N x N x N..... table join.

vesus in query (A).

    I do

    1 x 1 x 1...join and do it N times.

which one would be faster? Received on Wed Oct 27 2004 - 16:46:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US