# Question about TTL & tombstones

**URL:** <https://forum.scylladb.com/t/question-about-ttl-tombstones/831>\
**Category:** ScyllaDB\
**Tags:** ttl, compaction\
**Created:** [September 8, 2023, 2:30pm UTC](https://forum.scylladb.com/t/question-about-ttl-tombstones/831 "2023-09-08T14:30:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![horschi](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@horschi](https://forum.scylladb.com/u/horschi)\
**Post date:** [September 8, 2023, 2:30pm UTC](https://forum.scylladb.com/t/question-about-ttl-tombstones/831/1 "2023-09-08T14:30:09Z")

</div>

Hi,

the documenation [Time to Live (TTL) and Compaction | ScyllaDB Docs](https://opensource.docs.scylladb.com/stable/kb/ttl-facts.html) states “If the data time stamp + gc\_grace\_seconds is less than or equal to the current time (now), the data is thrown away and a tombstone is **not** created.”.

So basically the Cassandra fix [[CASSANDRA-4917] Optimize tombstone creation for ExpiringColumns - ASF JIRA](https://issues.apache.org/jira/browse/CASSANDRA-4917) is already included in Scylla?

So this means I will not have any tombstones if I do the following?

- Write row without TTL
- Overwrite existing record with TTL of 10 days (basically a app-level delete)

This way I could track my deletes and write a range tombstone if I find many of my own app-level deletes.

Sorry for asking, but I was not able to find the TTL logic in the Scylla codebase.

cheers,  
Christian

---

<div class="post-metadata">

**Author:** ![Botond\_Denes](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.scylladb.com/botond_denes/32/163_2.png) [@Botond\_Denes](https://forum.scylladb.com/u/Botond_Denes)\
**Post date:** [September 11, 2023, 6:16am UTC](https://forum.scylladb.com/t/question-about-ttl-tombstones/831/2 "2023-09-11T06:16:23Z")

</div>

Yes, that is correct. Expired cells do not necessarily create a tombstone upon expiry, only in the case where the expiry was less than gc grace period.  
See this commit: [https://github.com/scylladb/scylladb/commit/a6f8f4fe24](https://github.com/scylladb/scylladb/commit/a6f8f4fe24)

---

<div class="post-metadata">

**Author:** ![horschi](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@horschi](https://forum.scylladb.com/u/horschi)\
**Post date:** [September 11, 2023, 8:41am UTC](https://forum.scylladb.com/t/question-about-ttl-tombstones/831/3 "2023-09-11T08:41:58Z")

</div>

Thanks for the confirmation. Also thanks for the commit, I was already looking for the code 🙂
