Nonstop Database, HiRDB Version 9 System Operation Guide
(1) Deleting a selected row
To delete a selected row, the WHERE clause must be specified in the DELETE statement.
(2) Deleting all rows
To delete all rows from a table, the following SQL must be executed:
- DELETE statement with the WHERE clause not specified
- PURGE TABLE statement
- Points to be considered
- When all rows are to be deleted from a table that contains many rows, the PURGE TABLE statement deletes rows faster than the DELETE statement.
- When many rows are to be deleted with the DELETE statement, the lock mode should be set by first executing the LOCK statement with EXCLUSIVE specified in order to reduce the overhead for exclusive control.
- Deleting many rows with the DELETE statement has no effect on the free space in the user RDAREAs, because the segments remain allocated. To create free space, the PURGE TABLE statement must be used.
All Rights Reserved. Copyright (C) 2011, 2015, Hitachi, Ltd.