# Deletion

**URL:** https://discuss.aerospike.com/c/aerospike-features/deletion/137.md

[Latest](https://discuss.aerospike.com/latest.md) · [Categories](https://discuss.aerospike.com/categories.md) · [Tags](https://discuss.aerospike.com/tags.md)

---

## [About the Deletion category](https://discuss.aerospike.com/t/about-the-deletion-category/1583)

<div class="topic-metadata">

**Author:** [@Mnemaudsyne](https://discuss.aerospike.com/u/Mnemaudsyne)\
**Replies:** 0

</div>

Discussion about Deletion

---

## [Delete sets matching regex. Code Injection](https://discuss.aerospike.com/t/delete-sets-matching-regex-code-injection/10542)

<div class="topic-metadata">

**Author:** [@zingoba](https://discuss.aerospike.com/u/zingoba)\
**Replies:** 1\
**Last updated:** [September 26, 2023, 1:18am UTC](https://discuss.aerospike.com/t/delete-sets-matching-regex-code-injection/10542 "2023-09-26T01:18:08Z")

</div>

Hi guys, We have run into a peculiar problem. Due to a bad legacy code, our cluster was exposed to code injection attack. The adversary was able to breach and ended up creating lots of sets in our namespace. We have plu…

---

## [Expiring an entire set using a lua script](https://discuss.aerospike.com/t/expiring-an-entire-set-using-a-lua-script/10512)

<div class="topic-metadata">

**Author:** [@srikumarkpz](https://discuss.aerospike.com/u/srikumarkpz)\
**Replies:** 4\
**Last updated:** [September 14, 2023, 9:02pm UTC](https://discuss.aerospike.com/t/expiring-an-entire-set-using-a-lua-script/10512 "2023-09-14T21:02:51Z")

</div>

Hi, Came across this solution in stackoverflow where you can delete entire contents of a set by updating the TTL: Changing TTL for a set in Aerospike with AQL - Stack Overflow Would like to apply this solution in our p…

---

## [How to delete a record based on secondary index?](https://discuss.aerospike.com/t/how-to-delete-a-record-based-on-secondary-index/2262)

<div class="topic-metadata">

**Author:** [@shamik](https://discuss.aerospike.com/u/shamik)\
**Replies:** 4\
**Last updated:** [May 19, 2023, 5:59pm UTC](https://discuss.aerospike.com/t/how-to-delete-a-record-based-on-secondary-index/2262 "2023-05-19T17:59:41Z")

</div>

Hi, I’m trying to delete a record based on a secondary index value. I’m using java API and the only thing it supports right now seemed to be based on PK. Here’s an example on what I’m trying to do :smile: Following are…

---

## [Future Discussion](https://discuss.aerospike.com/t/future-discussion/10112)

<div class="topic-metadata">

**Author:** [@Abdul\_Majid](https://discuss.aerospike.com/u/Abdul_Majid)\
**Replies:** 1\
**Last updated:** [April 19, 2023, 8:32pm UTC](https://discuss.aerospike.com/t/future-discussion/10112 "2023-04-19T20:32:06Z")

</div>

Continuing the discussion from How to delete all records in set / Deleted set or records get restored on 'restart':

---

## [Multiple rows delete: how to write a delete query](https://discuss.aerospike.com/t/multiple-rows-delete-how-to-write-a-delete-query/1564)

<div class="topic-metadata">

**Author:** [@abhishekptrt](https://discuss.aerospike.com/u/abhishekptrt)\
**Replies:** 23\
**Last updated:** [May 26, 2021, 8:20pm UTC](https://discuss.aerospike.com/t/multiple-rows-delete-how-to-write-a-delete-query/1564 "2021-05-26T20:20:13Z")

</div>

Hi all, I am new in aerospike . I have create a namespace say “Company” with in that i have set “Products” and bins are (data,k, product\_id, product\_type) I want to write the delete query a) delete all product of p…

---

## [How to delete all records in set / Deleted set or records get restored on 'restart'](https://discuss.aerospike.com/t/how-to-delete-all-records-in-set-deleted-set-or-records-get-restored-on-restart/255)

<div class="topic-metadata">

**Author:** [@oldforum](https://discuss.aerospike.com/u/oldforum)\
**Replies:** 15\
**Last updated:** [October 9, 2020, 12:29am UTC](https://discuss.aerospike.com/t/how-to-delete-all-records-in-set-deleted-set-or-records-get-restored-on-restart/255 "2020-10-09T00:29:22Z")

</div>

Post by arayappan » Thu Oct 24, 2013 9:37 pm Hi All, I want to delete all records in a set(table). is there any command in aerospike to delete all records in set like “DELETE FROM test.test-set”? Thanks & Regards, Ray…

---

## [Delete records in Aerospike?](https://discuss.aerospike.com/t/delete-records-in-aerospike/6948)

<div class="topic-metadata">

**Author:** [@lmq1999](https://discuss.aerospike.com/u/lmq1999)\
**Replies:** 1\
**Last updated:** [December 17, 2019, 12:39am UTC](https://discuss.aerospike.com/t/delete-records-in-aerospike/6948 "2019-12-17T00:39:15Z")

</div>

I’m tuning Aerospike, after I use Recipe for an SSD Storage Engine with this config: namespace test { replication-factor 2 memory-size 4G default-ttl 30d # 30 days, use 0 to never expire/evict. …

---

## [Expired records takes old values and update TTL](https://discuss.aerospike.com/t/expired-records-takes-old-values-and-update-ttl/5810)

<div class="topic-metadata">

**Author:** [@Eliya\_Ben\_Abu](https://discuss.aerospike.com/u/Eliya_Ben_Abu)\
**Replies:** 12\
**Last updated:** [January 14, 2019, 10:18pm UTC](https://discuss.aerospike.com/t/expired-records-takes-old-values-and-update-ttl/5810 "2019-01-14T22:18:27Z")

</div>

Hello, I’m using aerospike community edition version 4.4.0.4, I have records that used as counters with TTL, when i’m updating the record i set the TTL to not be updated, when the record is expired I expected the record …

---

## [Delete Expired Objects](https://discuss.aerospike.com/t/delete-expired-objects/5604)

<div class="topic-metadata">

**Author:** [@Igor](https://discuss.aerospike.com/u/Igor)\
**Replies:** 7\
**Last updated:** [October 25, 2018, 10:04am UTC](https://discuss.aerospike.com/t/delete-expired-objects/5604 "2018-10-25T10:04:06Z")

</div>

Hello. Sorry, maybe I duplicate some of the existing questions, but want to ask. Is it possible to delete completely Expired objects in aerospike community version (something like truncate command) ? Without deleting ex…

---

## [Tip-clear not working if used outside asadm prompt](https://discuss.aerospike.com/t/tip-clear-not-working-if-used-outside-asadm-prompt/5586)

<div class="topic-metadata">

**Author:** [@amit.netwk](https://discuss.aerospike.com/u/amit.netwk)\
**Replies:** 3\
**Last updated:** [October 15, 2018, 5:42am UTC](https://discuss.aerospike.com/t/tip-clear-not-working-if-used-outside-asadm-prompt/5586 "2018-10-15T05:42:21Z")

</div>

tip-clear command is working fine when run inside asadm prompt Admin\> asinfo -v 'tip-clear:host-port-list=192.168.3.105:3002' sps-me-2-db-1:3000 (192.168.3.103) returned: ok sps-me-2-db-2:3000 (192.168.3.104) returned:…

---

## [How is data deleted?](https://discuss.aerospike.com/t/how-is-data-deleted/183)

<div class="topic-metadata">

**Author:** [@oldforum](https://discuss.aerospike.com/u/oldforum)\
**Replies:** 7\
**Last updated:** [May 25, 2018, 2:01pm UTC](https://discuss.aerospike.com/t/how-is-data-deleted/183 "2018-05-25T14:01:51Z")

</div>

How is data deleted? Aerospike separates the data into two parts: index and value. The index is always stored in DRAM, the value can be stored in either SSD or DRAM (with or without disk for persistence). When a record i…

---

## [Why does Aerospike not utilise this method?](https://discuss.aerospike.com/t/why-does-aerospike-not-utilise-this-method/4518)

<div class="topic-metadata">

**Author:** [@jacksenk](https://discuss.aerospike.com/u/jacksenk)\
**Replies:** 5\
**Last updated:** [August 23, 2017, 9:36pm UTC](https://discuss.aerospike.com/t/why-does-aerospike-not-utilise-this-method/4518 "2017-08-23T21:36:34Z")

</div>

Consider me curious. I am sure Aerospike would be using this if it was viable, so I’d be interested to hear why something like this isn’t viable. Currently, Aerospike removes the reference from the index in memory, howe…

---

## [What is the right way to delete sets completely?](https://discuss.aerospike.com/t/what-is-the-right-way-to-delete-sets-completely/1556)

<div class="topic-metadata">

**Author:** [@yesteapea](https://discuss.aerospike.com/u/yesteapea)\
**Replies:** 16\
**Last updated:** [July 24, 2017, 6:34pm UTC](https://discuss.aerospike.com/t/what-is-the-right-way-to-delete-sets-completely/1556 "2017-07-24T18:34:15Z")

</div>

Im my workplace we need to have multiple versions of data . So we are planning to store each version of data in a different set. But then we have to delete stale unused sets. What is is the best way to do this? As there…

---

## [Expired/Deleted data reappears after server is restarted](https://discuss.aerospike.com/t/expired-deleted-data-reappears-after-server-is-restarted/470)

<div class="topic-metadata">

**Author:** [@Hanson](https://discuss.aerospike.com/u/Hanson)\
**Replies:** 55\
**Last updated:** [June 8, 2017, 11:41am UTC](https://discuss.aerospike.com/t/expired-deleted-data-reappears-after-server-is-restarted/470 "2017-06-08T11:41:28Z")

</div>

Aerospike 3.3.19 In-Memory + Disk Persistence, single node. With conf: default-ttl 0 # Never expire/evict fsync-max-sec 1 flush-max-ms 30000 In an empty DB, using C client to: Insert a record via aerospike\_key\_put(). …

---

## [Is there a way to easily delete a namespace (remove from asp)?](https://discuss.aerospike.com/t/is-there-a-way-to-easily-delete-a-namespace-remove-from-asp/3454)

<div class="topic-metadata">

**Author:** [@dfc](https://discuss.aerospike.com/u/dfc)\
**Replies:** 2\
**Last updated:** [June 7, 2017, 9:56pm UTC](https://discuss.aerospike.com/t/is-there-a-way-to-easily-delete-a-namespace-remove-from-asp/3454 "2017-06-07T21:56:12Z")

</div>

Is there a cli or aql command to delete en entire namespace ? About changing its name ? I guess I could remove this namespace from the config file, shut down all the servers and restart them… but I’m wondering if there …

---

## [When Aerospike Community version evict expired record from disk?](https://discuss.aerospike.com/t/when-aerospike-community-version-evict-expired-record-from-disk/4080)

<div class="topic-metadata">

**Author:** [@RockyTu](https://discuss.aerospike.com/u/RockyTu)\
**Replies:** 4\
**Last updated:** [April 17, 2017, 3:03am UTC](https://discuss.aerospike.com/t/when-aerospike-community-version-evict-expired-record-from-disk/4080 "2017-04-17T03:03:29Z")

</div>

Hi all, I use Aerospike community version 3.8.3. I set TTL for some records (persistence in my disk), and they will expired in near future. This temporary data is huge and take a big volume of disk, therefore, I expected…

---

## [How do I remove a set?](https://discuss.aerospike.com/t/how-do-i-remove-a-set/771)

<div class="topic-metadata">

**Author:** [@suthindran](https://discuss.aerospike.com/u/suthindran)\
**Replies:** 27\
**Last updated:** [March 30, 2017, 10:13pm UTC](https://discuss.aerospike.com/t/how-do-i-remove-a-set/771 "2017-03-30T22:13:52Z")

</div>

As the no. of sets are limited to 1023, is it possible to remove a set once created either through API or through asinfo. I tried using the following command: asinfo -v "set-config:context=namespace;id=blocked;set=testse…

---

## [Is the truncate function persistent?](https://discuss.aerospike.com/t/is-the-truncate-function-persistent/3961)

<div class="topic-metadata">

**Author:** [@Crags](https://discuss.aerospike.com/u/Crags)\
**Replies:** 1\
**Last updated:** [March 30, 2017, 2:07am UTC](https://discuss.aerospike.com/t/is-the-truncate-function-persistent/3961 "2017-03-30T02:07:47Z")

</div>

Hi. The new truncate function is brilliant for us removing redundant data in the CE edition on server restart as it seems to be lightning fast, and so far very consistent across the cluster. The question I am wondering i…

---

## [Complications during and after set deletion (AER-4890)](https://discuss.aerospike.com/t/complications-during-and-after-set-deletion-aer-4890/994)

<div class="topic-metadata">

**Author:** [@ikounakis](https://discuss.aerospike.com/u/ikounakis)\
**Replies:** 13\
**Last updated:** [March 17, 2017, 12:10am UTC](https://discuss.aerospike.com/t/complications-during-and-after-set-deletion-aer-4890/994 "2017-03-17T00:10:41Z")

</div>

I have attempted to delete a set at runtime following the instructions outlined here a couple of times, but unfortunately in both cases it didn’t go so well. The first time, after a few seconds of a huge burst in writes…

---

## [Found existence of deleted and expired records in Aerospike!](https://discuss.aerospike.com/t/found-existence-of-deleted-and-expired-records-in-aerospike/1486)

<div class="topic-metadata">

**Author:** [@Shiva\_Kumar](https://discuss.aerospike.com/u/Shiva_Kumar)\
**Replies:** 7\
**Last updated:** [December 29, 2016, 10:34am UTC](https://discuss.aerospike.com/t/found-existence-of-deleted-and-expired-records-in-aerospike/1486 "2016-12-29T10:34:02Z")

</div>

Installed new version of aerospike 3.4 community edition and created a namespace with configuration, namespace users{ replication-factor 1 memory-size 2G default-ttl 0 # 24 Hours, use 0 to never expire/evict…

---

## [Reading the old record](https://discuss.aerospike.com/t/reading-the-old-record/3562)

<div class="topic-metadata">

**Author:** [@AJVee](https://discuss.aerospike.com/u/AJVee)\
**Replies:** 0\
**Last updated:** [October 28, 2016, 2:41pm UTC](https://discuss.aerospike.com/t/reading-the-old-record/3562 "2016-10-28T14:41:58Z")

</div>

Hi, I have tis peculiar situation where, my read returns an old record that has been modified many times in the past few days. In Detail: First writing a record with the following WritePolicy settings: wPolicy.recor…

---

## [How to ensure that deleted data from set does not come back?](https://discuss.aerospike.com/t/how-to-ensure-that-deleted-data-from-set-does-not-come-back/1306)

<div class="topic-metadata">

**Author:** [@Slader](https://discuss.aerospike.com/u/Slader)\
**Replies:** 3\
**Last updated:** [October 11, 2016, 7:09pm UTC](https://discuss.aerospike.com/t/how-to-ensure-that-deleted-data-from-set-does-not-come-back/1306 "2016-10-11T19:09:54Z")

</div>

Hello. After restart of the server, ‘zombie-records’ could appear due to the fact that we’ve deleted the whole set for example. How could we figure out if all of the records that are scheduled for deletion are erased fro…

---

## [Delete record in aerospike](https://discuss.aerospike.com/t/delete-record-in-aerospike/1619)

<div class="topic-metadata">

**Author:** [@max83](https://discuss.aerospike.com/u/max83)\
**Replies:** 4\
**Last updated:** [October 11, 2016, 7:09pm UTC](https://discuss.aerospike.com/t/delete-record-in-aerospike/1619 "2016-10-11T19:09:22Z")

</div>

I could not understand why when I delete record and then restart aerospike record come back (it is again in the “set”)? Is it normal? How I can delete it forever?

---

## [Record deletions while migrations are taking place](https://discuss.aerospike.com/t/record-deletions-while-migrations-are-taking-place/3476)

<div class="topic-metadata">

**Author:** [@AJVee](https://discuss.aerospike.com/u/AJVee)\
**Replies:** 3\
**Last updated:** [October 11, 2016, 7:08pm UTC](https://discuss.aerospike.com/t/record-deletions-while-migrations-are-taking-place/3476 "2016-10-11T19:08:44Z")

</div>

Hi folks, I am using a java scan call back to read all the records in a set and delete them on the cluster. I now want to consider these deletions when the cluster is in a migration state. Please help me analyze the d…

---

## [How to delete multiple records on the bases of secondary index](https://discuss.aerospike.com/t/how-to-delete-multiple-records-on-the-bases-of-secondary-index/3465)

<div class="topic-metadata">

**Author:** [@Anuj\_Gupta](https://discuss.aerospike.com/u/Anuj_Gupta)\
**Replies:** 1\
**Last updated:** [October 1, 2016, 4:05am UTC](https://discuss.aerospike.com/t/how-to-delete-multiple-records-on-the-bases-of-secondary-index/3465 "2016-10-01T04:05:15Z")

</div>

how to delete multiple records on the bases of secondary index

---

## [Read whole record and delete it with one request?](https://discuss.aerospike.com/t/read-whole-record-and-delete-it-with-one-request/2925)

<div class="topic-metadata">

**Author:** [@tuxofil](https://discuss.aerospike.com/u/tuxofil)\
**Replies:** 1\
**Last updated:** [May 10, 2016, 12:02pm UTC](https://discuss.aerospike.com/t/read-whole-record-and-delete-it-with-one-request/2925 "2016-05-10T12:02:51Z")

</div>

Is there is an ability to atomically read all bins from the record and delete it completely? No other client should be able to update the record between the read and deletion.

---

## [Updates disappear after recovery nodes from crash](https://discuss.aerospike.com/t/updates-disappear-after-recovery-nodes-from-crash/1952)

<div class="topic-metadata">

**Author:** [@manana](https://discuss.aerospike.com/u/manana)\
**Replies:** 3\
**Last updated:** [January 7, 2016, 8:05am UTC](https://discuss.aerospike.com/t/updates-disappear-after-recovery-nodes-from-crash/1952 "2016-01-07T08:05:32Z")

</div>

We have 6 nodes cluster with replication factor 3 (aerospike CE 3.6.0). Namespace is configured to store data in memory with data persistence file. Data is updated once a day at midnight. During a simulation of massive h…

---

## [Why expired-objects \> (evicted-objects+ object)](https://discuss.aerospike.com/t/why-expired-objects-evicted-objects-object/2123)

<div class="topic-metadata">

**Author:** [@mwang](https://discuss.aerospike.com/u/mwang)\
**Replies:** 8\
**Last updated:** [November 18, 2015, 10:42pm UTC](https://discuss.aerospike.com/t/why-expired-objects-evicted-objects-object/2123 "2015-11-18T22:42:23Z")

</div>

I found the expired-objects is about 450k, while evicted-objects is only 23K and object is only about 290K refactor is 2 and the number of object includes backup objects I get this data from aerospike console

---

## [Set Retention after Aerospike restart](https://discuss.aerospike.com/t/set-retention-after-aerospike-restart/2105)

<div class="topic-metadata">

**Author:** [@ManishOjha](https://discuss.aerospike.com/u/ManishOjha)\
**Replies:** 2\
**Last updated:** [November 16, 2015, 8:43am UTC](https://discuss.aerospike.com/t/set-retention-after-aerospike-restart/2105 "2015-11-16T08:43:40Z")

</div>

I am trying to add sets and bins in 3 namespaces, and it is getting added as well. however whenever I restart my server all sets gets deleted. It says Number of objects inside namespaces is 0. I would like to retain thes…

[Next page](https://discuss.aerospike.com/c/aerospike-features/deletion/137.md?page=1)
