Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SCD-2 table Date partition - Query

HeshSep 20 2020 — edited Sep 23 2020

Hi,

pastedImage_0.png

The PRICE table is having 100 Billion records, its partitioned by TYPE_KEY & FROM_DT.

T_PRICE ( sku_key number, type_key number, price number, from_dt date, to_dt date, is_current varchar2(1));

Most of the queries uses partitioned columns TYPE_KEY and FROM_DT but also uses TO_DT.

When we use TO_DT, optimizer is doing a full table scan! I believe Optimizer do not know the relation between FROM_DT & TO_DT

Its doing good when we use only FROM_DT, we can understand that.

pastedImage_3.png

When we use only FROM_DT

pastedImage_1.png

Appreciate your advise and comments.

Regards

Hesh

Comments
Post Details
Added on Sep 20 2020
16 comments
1,110 views