943,973 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Marked Solved
  • Views: 1426
  • Oracle RSS
Oct 28th, 2009
0

Oracle table design help

Expand Post »
I have around 2 million vouchers of some fixed denomination (say 10 and 20)
Oracle Syntax (Toggle Plain Text)
  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
Oracle Syntax (Toggle Plain Text)
  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)
Oracle Syntax (Toggle Plain Text)
  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; Oct 28th, 2009 at 2:57 am. Reason: Oracle version
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
johnbach is offline Offline
2 posts
since Oct 2009
Nov 2nd, 2009
0
Re: Oracle table design help
Oracle Advanced Queuing solved the problem.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
johnbach is offline Offline
2 posts
since Oct 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Oracle Forum Timeline: What all i can include in my project??
Next Thread in Oracle Forum Timeline: dbms





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC