Documente Academic
Documente Profesional
Documente Cultură
Hasso Plattner
A Course in
In-Memory Data Management
The Inner Mechanics
of In-Memory Databases
The delete operation terminates the validity of a given tuple. It stores the
information in the database that a certain item is no longer valid. This oper-
ation can either be of physical or logical nature. A physical delete operation
removes an item from the database so that it is no longer physically ac-
cessible. In contrast, a logical delete operation only terminates the validity
of an item in the dataset, but keeps the tuple still available for temporal
queries [Pla09].
The SQL syntax for a delete statement looks like the following, where the
predicate may select a single or multiple tuples.
DELETE FROM table_name WHERE condition;
In the following example, all persons with the name ’Jane Doe’ are supposed
to be removed from a database table storing first and last names. Based on
the applied dictionary encoding (see Chapter 6), the table consists of two
columns with a dictionary and attribute vector each.
69
70 10 Delete
First, the valueIDs for the first and last name need to be identified. Jane cor-
responds to valueID 23 and Doe to valueID 18, according to their respective
dictionary.
Next, we scan through the attribute vectors and find the appropriate
positions, which means we look up the recordIDs for these values. In our
example, there is only one tuple with that combination of first and last name.
When finally deleting the two values from the attribute vectors, all subse-
quent tuples need to be adjusted to maintain a sequence without gaps and
they are moved to preserve a sequential memory area. This implementation
alternative of the delete operation is therefore very expensive in terms of per-
formance. In Chapter 26, later during the course, the insert-only approach is
presented as a better alternative to implement deletion in typical enterprise
use cases. This approach is of logical nature.
10.2 References