Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> inserting empty records makes updates faster?
We will have a need to frequently increment a column in a row in any of
a fixed set of possible rows if the row exists, or insert the row if it
doesnt.
We want this process to be very fast, since it will be done often.
It's been suggested that we initialize the table with all possible entries set to 0 so that we can merely do an:
[update]
rather than a
[try to update but if it fails do an insert]
along the thinking that the one operation is faster than two. Is this
faster, or does the database need to do the same work anyway?
We're using Oracle 805. Does the db have an atomic "update row if it's there or insert it if it's not" method that would be useful here?
thanks!
--
David Michaels <david_at_shockmarket.com>
Director of Technology
ShockMarket Corporation (650) 330-4665
Received on Tue Jun 29 1999 - 15:30:58 CDT