In oracle, the time used by commit is not affected by the transaction size. The overhead of commit has two factors: the round-trip communication with the database. If each record is submitted, the generated round-trip traffic will be much larger. Each submission must wait for the redo to be written to the disk;
Execute the commit command to generate an scn www.2cto.com lgwr for the transaction, write the cached redo log entries to the disk, and record the scn to the online redo log file; releasing v $ lock records the locks held by our sessions;
If the transaction modified block still exists in the block buffer cache, it will be cleared for later transactions. Lgwr usually takes less time. The reason why this operation time can be greatly reduced is that lgwr has been writing data to the disk in a continuous manner, and we usually wait for lgwr to complete all the write operations, and will be returned only when the data has been confirmed on the disk. PL/SQL provides commit optimization. After pl/SQL routines are completed, when we return data from the database to the client, it needs to wait until the commit call returns immediately.