Overlapping Versions and Deletions

To delete data when using table-level versioning, you may actually need to increase disk space by adding a dbspace to your IQ main store.

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

For example, say you must delete 10 rows from a database where each page holds 100 rows. If each of those 10 rows is on a separate data page, then your IQ main store must have space for 10 version pages, each big enough to hold 100 rows. This distribution is unlikely, but it is 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, SAP Sybase IQ halts the deletion and writes 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 normally need that much space in your database, you can drop the dbspace to regain the extra disk space for other purposes. Do so before inserting any data that may need 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 must shut down the database engine and then restart it, allowing the database to roll back. You can then delete the rows in smaller, separate transactions.

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.