sql - Oracle Partition Pruning with bind variables -


I have a large (150 M + line) table, which is divided into quarters using the DATE partition key .

When I ask something like table ...

  SELECT * to LARGE_TABLE where THE_PARTITION_DATE & gt; = TO_DATE ('1/1/2009', 'DD / MM / YYYY') and THE_PARTITION_DATE & lt; TO_DATE ('1/4/2009', 'DD / MM / YYYY');  

... The sorting of division works correctly ... Optimizer is able to realize that it only needs to see a partition (in this case Q1 2009) . The Applelin Plan "Partition Range Single" shows

However, when I pass this query to PL / SQL and pass it on the same date as the same, then the scheme "Partition Range (ITIETER) "... the optician is unable to understand that he only needs to see the single partiton (presumably because there is no real value in it when it evaluates the plan).

I have only seen the round of the round so far the code is meant to make an execution instantaneously which includes the dates in the SQL string so that the split split works correctly.

Is there any better way?

I do not think you should see a real performance difference with bind variable - Partition: Key "... should see an execution plan phase which means that Oracle will determine the start and stop segmentation at execution time.


Comments