DELETE

❗️

This is a legacy Apache Ignite documentation

The new documentation is hosted here: https://ignite.apache.org/docs/latest/

Delete data from a table.

DELETE
  [TOP term] FROM tableName 
  [WHERE expression] 
  [LIMIT term]

Parameters

  • tableName - the name of the table to delete data from.
  • TOP, LIMIT - specifies the number​ of entries to be deleted (no limit if null or smaller than zero).

Description

DETELE command removes data from a table (aka. cache in Ignite).

Since Ignite stores all the data in a form of key-value pairs, all the DELETE statements are finally transformed into a set of key-value operations.

DELETE statements' execution is split into two phases and is similar to the execution of UPDATE statements.

First, using a SELECT query, the SQL engine gathers those keys that satisfy the WHERE clause in the DELETE statement. Next, after having all those keys in place, it creates a number of EntryProcessors and executes them with cache.invokeAll(...). While the data is being deleted, additional checks are performed to make sure that nobody has interfered between the SELECT and the actual removal of the data.

Refer to concurrent modifications section that explains how SQL engine solves concurrency issues.

Examples

Delete all the Persons with a specific name:

DELETE FROM Person WHERE name = 'John Doe';

Note

Java, .NET, C++ users can execute DELETE queries using native APIs:

See Also