1st
A reader, August 21, 2017 - 5:32 pm UTC
Before your must tell us if the table is updated and how ? Is the table for oltp dwh or both transactions.
First idea that comes up is the table partitioned ?
If not I suggest a partitioning on cardsn interval if number otherwise why not hash 64. Then tune to look for a global partition index on cardsn+trans#
This works d'or the pk index as the cardsn is the key partition.
Lot of solutions around . why not a virtual col if the cardsn is numeric varchar2 to convert into number for interval partitioning. ..
August 22, 2017 - 1:09 pm UTC
What's partitioning got to do with this? The OP was asking about enforcing uniqueness...
Type of transactions
Emad, August 22, 2017 - 4:41 pm UTC
Thank you guys
Transactions are OLTP and table is partitioned with hash of cardsn
I used partitioned index because all searches are with cardsn and transactionid
The key is Reference number, an always unique number from bigbang till the end and its used also in many searches more than cardsn.
I have a unique constraint on cardsn+transactionid
The question was is this method good or bad.
The TPS in peak time is 40K and 40,000,000 transactions a day
Cardsn is raw(4) so threated as unsigned int number
I would like to know if a bitmap index on transaction id will help insertion or not
This table is not used for reporting. A more indexed tabled of same data is used for reporting
Any more data?
August 24, 2017 - 1:10 pm UTC
Is what good or bad? Having a unique constraint?
If cardsn+transactionid is unique, then YES! this is a fantastic idea!
As cardsn is your partitioning key, you could make the index for this constraint locally partitioned too.
I would like to know if a bitmap index on transaction id will help insertion or not
No. No indexes will "help insertion". In fact, you've given the database more work to do. It now has to update the index as well as add the data.
Emad, August 24, 2017 - 1:15 pm UTC
Thank you chris. Yep i used local index as I call it partiotioned index.
I tought that a bitmap index on transactionid will help insertion because it can easily checks wheter if its unique or duplicate
As you mentioned the current index is fast enough and I will not use an additional bitmap index.
Regards
CLOSED
August 24, 2017 - 3:49 pm UTC
Thank you CLOSED