Overlapping Versions and Deletions

To delete data, you may need to increase disk space by adding a dbspace to your IQ store.

The amount of space needed for a deletion depends on the distribution of the data on data pages, more than on the size or number of rows deleted. IQ needs to retain a version of each page that contains any data that you are deleting, from the time the deletion starts until the transaction commits. If the rows being deleted occupy many data pages, then you need space in your IQ store to retain all of those extra data pages.

For example, assume that you need to delete ten rows from a database where each page holds 100 rows. If each of those ten rows is on a separate data page, then your IQ store requires space for ten version pages, each big enough to hold 100 rows. This distribution is unlikely, but possible.

The space needed to delete data varies by index type. It is proportional to—and in the worst case, equal to—the size of the index from which you are deleting.

If you run out of space while deleting data, Sybase IQ halts the deletion and displays this message in the notification log:
Out of disk space
After you add space, the deletion resumes. When the delete transaction commits, the space becomes available for other deletions or insertions. If you do not need normally that much space in your database, you can drop the dbspace to regain the extra disk space for other purposes. Be sure you do so before inserting any data which might need to use the new dbspace.

Running out of space during a deletion should not affect other query users.

If you run out of space, but do not have enough disk space to add another dbspace, you can delete the rows in smaller, separate transactions. Two checkpoints should follow each small delete transaction. If deleting rows in small transactions does not work, you may need to restart the Sybase IQ server.

Note: DROP TABLE and DROP DATABASE delete the table or database and all data in it without creating any version pages, so you do not need to add space to use these commands.
Related concepts
Disk Space Usage