Oracle table design help

Thread Solved

Join Date: Oct 2009
Posts: 2
Reputation: johnbach is an unknown quantity at this point 
Solved Threads: 0
johnbach johnbach is offline Offline
Newbie Poster

Oracle table design help

 
0
  #1
28 Days Ago
I have around 2 million vouchers of some fixed denomination (say 10 and 20)
  1. CREATE TABLE vouchers(pin VARCHAR2(20) PRIMARY KEY ,amount NUMBER,status CHAR(1),extra_value NUMBER);
  2. CREATE INDEX IDX_AMOUNT_STATUS ON vouchers(amount,status);
Typical values
  1. amount,status ,COUNT(status)
  2. 10 N 1000000
  3. 10 U 700000
  4. 20 N 300000
For each payment transaction,I fetch one voucher wrt.transaction amount and mark it as used
(So it will not be used for any other transaction)
  1. UPDATE vouchers SET status='U'
  2. WHERE amount=:txn_amount AND staus='N' AND ROWNUM=1
  3. RETURNING pin,extra_value INTO :pin,:extra;
I have 10 parallel threads processing incoming transaction. I am expecting 30 transactions per second.
Initially the update takes 0.002 millisecond but after few hours it reaches 2 seconds.

I even tried with partitioning table also(status N one partition and defalut another partition).

Platform details
Linux RHEL 5
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production

Suggestions please.
Last edited by johnbach; 28 Days Ago at 2:57 am. Reason: Oracle version
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: johnbach is an unknown quantity at this point 
Solved Threads: 0
johnbach johnbach is offline Offline
Newbie Poster
 
0
  #2
23 Days Ago
Oracle Advanced Queuing solved the problem.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Oracle Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC