ALL, I have a DB with some data. I also have a C++ application that communicates with the DB.
Which scenario is more efficient?
Scenario 1:
- User hit "Edit Data" button.
- Program reads data from DB and presents it for editing
- User edit the data and hit "Save" button
- Program creates new object with the newly saved data then makes the comparison with the old object.
- Program issues some UPDATE statements.
Scenario 2:
- Steps 1-3 are the same.
- Program overwrites an old object data with the new data.
- Program issue DELETE/INSERT statements in one transaction.
I'm inclined to say scenario 2.