Thank you for your time and providing the references. I'm still struggling to understand how
index compression would work in a partition & subpartition example (I totally understand it in a non-partitioned example though!!). Please bear with me while I explain it with a simple example:
If i've a following sample data:
02-JAN-16, SERVICE #1, OPERATION #1, ORD_0001
02-JAN-16, SERVICE #1, OPERATION #1, ORD_0002
02-JAN-16, SERVICE #1, OPERATION #2, ORD_0003
In simplistic terms, the
LOCAL PARITIONED index data organisation could be visualised as:
02-JAN-16 (<--PARTITION)
SERVICE #1, OPERATION #1 (block #1) (<--SUBPARTITION HASHED)
ORD_0001, (ROW ID corresponding to ORD_0001 row)
ORD_0002, (ROW ID corresponding to ORD_0002 row)
SERVICE #1, OPERATION #2 (block #2) (<--SUBPARTITION HASHED)
ORD_0003, (ROW ID corresponding to ORD_0003 row)
From the above visualisation, the partition and subpartition columns (ORDER_CRT_DATE, SERVICE_NAME, SERVICE_OPERATION) are already used up to decide the partition & the block related to subpartition in which the indexed data needs to be stored. So, when it finally comes
to storing the index data in the block, would it still store the index data as shown below(just like in a non-partitioned index), so that the compression could then be applied on the first 3 columns?
02-JAN-16 (<--PARTITION)
SERVICE #1, OPERATION #1 (block #1) (<--SUBPARTITION)
02-JAN-16, SERVICE #1, OPERATION #1, ORD_0001, ROWID corresponding to ORD_0001
02-JAN-16, SERVICE #1, OPERATION #1, ORD_0002, ROWID corresponding to ORD_0002
(OR) would it just store only the ORDER_ID & ROWID because the first 3 columns in the index would always decide which partition & subpartition the data resides, hence it is redundant to store partition & subpartitions column data:
02-JAN-16 (<--PARTITION)
SERVICE #1, OPERATION #1 (block #1) (<--SUBPARTITION)
ORD_0001, (ROW ID corresponding to ORD_0001 row)
ORD_0002, (ROW ID corresponding to ORD_0002 row)
If it is the latter, then, there is no index compression right?
Thanks again for your time and I really do appreciate your inputs. Thanks.
January 12, 2016 - 12:40 am UTC
Based on your DDL, the columns are *in* the index (even though they are the partition keys as well). So within the index structure, you are going to have that column data (and hence it will be compressed).
If you had done
create index MY_IX on T (ORDER_ID) local
then this would not have been the case.
But dont forget, there might be a huge difference between
"jump to the *exact* spot in the index for ORDER_CRT_DATE = 2015-01-02 12:34:00, SERVICE_NAME = ABC, SERVICE_OPERATION = 123, in the index... and then find ORDER_ID = 10"
versus
"jump to the index *partition* for ORDER_CRT_DATE = 2015-01-02, SERVICE_NAME = ABC, SERVICE_OPERATION = 123" and then scan along that index segment for ORDER_ID = 10
I'm not saying one is better than the other...I'm saying they have *different* characteristics.
Hope this helps.