Multiple rows delete: how to write a delete query

If you set the TTL to 1s, it will expire one second after being written. The record cannot be accessed by a get once it is expired, but it still needs the nsup thread to clean it up from the primary index. It’ll consume the 64B of DRAM in the primary index until it’s removed by the namespace supervisor.

Instead of changing the TTL to 1 second in order to remove a record, your code should call aerospike:remove(rec). See the aerospike module of the Lua UDF API. That will immediately remove the record’s metadata from the primary index.

What you were doing before (rather than updating the TTL) should work.