partition vs. rowid query
478454Nov 23 2009 — edited Nov 23 2009In Oracle 10g, I have a table that is partitioned on a date column by year.
I am wondering which query would be expected to perform better if all else is equal....
1. a query that selected using a condition that allowed for partition pruning
2. a query that selected using a specific identified partition in the "from" clause, plus perhaps another indexed column
2a. a query that selected using a specific identified partition in the "from" clause, plus the partitioning column has an index on it that is hit
3. a query that selected from the table using rowid
4. a query that selected using a specific identified partition in the "from" clause, plus by rowid
ex.
1. select a, b, c from table where table_date_column < identified_date;
2. select a, b, c from table (partition identified_partition) where indexed_table_column < identified_value;
2a. select a, b, c from table (partition identified_partition) where indexed_table_date_column < identified_value;
3. select a, b, c from table where table.rowid = user_identified_rowid;
4. select a, b, c from table (partition identified_partition) where table.rowid = user_identified_rowid;
Additionally, I'm wondering if the example statement no. 4, although the explain plan will not show any partitioning, if Oracle will indeed use just the specified partition. It seems that in the explain plan, the use of rowid takes over and I'm not sure that is the fastest access method when dealing with a partitioned table. The explain plan for example 2a is similar in that it shows use of my index on the date column, yet it will then not show use of partition. (Only the table is partitioned; the index is not.)
Thank you so much,
Bret