Insert or update ??
Posted in 1999
Hi all, I need some inputs on performance in following scenarios : Scenario 1 I have a table say t1. This table has 11 fields and 4 indexes (Record size : 180 bytes). I read records from this table and depending on some condition I have to set a expired flag for that record. Currently this table does not have a expired flag field. I have another table say t2 which stores the expired flag. This table has 2 indexes (Record Size : 15). Whenever the condition for expiry has matched, the process INSERTs the record in table t2. Scenario 2 Add a expired flags field to table t1 above. Now, whenever the expiry condition is matched the process will set the expired flag as TRUE for the record currently read and UPDATE the record in the database. In this case I no longer need the table t2. Which scenario will give better performance ? Thanks, Sanjay.