• Partioning is a great way to reduce index maintenance. It might even help the performance of certain types of queries. However, and I've not done it in Oracle, I can't see how "hash partitioning" will help anything because of the things I mentioned. It's about as effective as partitioning on NEWID() or any other random number.

    [EDIT] The only place I can see where it might help is to spread the load across drives as Gail just mentioned. What would be a much larger help is to fix the data and give it some sort of reasonable partitioning column.

    Consider the following example... we have some very easily sortable data that, under normal conditions, would appear in a single partition (say, the "A" partition out of 26 lettered partitions).

    SELECT HASHBYTES('SHA1','AAAAA') UNION ALL

    SELECT HASHBYTES('SHA1','AABAA') UNION ALL

    SELECT HASHBYTES('SHA1','AACAA') UNION ALL

    SELECT HASHBYTES('SHA1','AADAA') UNION ALL

    SELECT HASHBYTES('SHA1','AAEAA')

    Now, if we look at the HASHBYTES output of that, you'll easilly see that having similar data means nothing to HASHBYTES.

    0xC1FE3A7B487F66A6AC8C7E4794BC55C31B0EF403

    0x9F97773310D994CBEFDB584A0D1883EDBF610B28

    0x81778503C0258525DBE9F4D999CCB46EEB25379A

    0xE2A9D1EB98CFED14F12629EEF20B1A44B6E4E96A

    0x2F45DA2C2D16CCC875CC308C445A070D5957B3B2

    There are 5 items and the hashbytes all start with a different character. How is this going to help anything by partitioning? All 5 partitions got updates. That means that 5 indexes also got updated and you still have to go across all 5 partitions to return the 5 pieces of data that start with "AA".

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)