Using the lock table command to improve performance

The lock table command allows you to explicitly request that before a table is accessed, a table lock be put on it for the duration of a transaction. This is useful when an immediate table lock may reduce the overhead of acquiring a large number of row or page locks and save locking time. Examples of such cases are:

The syntax of lock table is:

lock table table_name in {share | exclusive} mode
          [wait [no_of_seconds] | nowait]

The wait/nowait option allows you to specify how long the command waits to acquire a table lock if it is blocked (see “wait/nowait option of the lock table command”).

These considerations apply to the use of lock table: