Docs: sql: provide documentation on row-level ttl workarounds

Created on 17 Oct 2019  Â·  7Comments  Â·  Source: cockroachdb/docs

We don't yet support row-level TTL. This feature is useful in that it cuts down on the effort developers need to take to delete and manage data.

In the meantime, we should document workarounds such as using cron jobs to periodically delete certain data in a performance first manner.

cc @rkruze who was asking about this.

A-sql C-doc-improvement O-sales-eng P-1 T-missing-info

Most helpful comment

Since @rohany's change that adds crdb_internal_mvcc_timestamp, we can recommend this pattern:

[email protected]:55288/defaultdb> delete from t where crdb_internal_mvcc_timestamp < 1597173188127148000.0000000000 LIMIT 10000;

All 7 comments

@awoods187 any progression on this?

We haven't prioritized the doc work here given the opportunity cost for other work. Do you want to make a case for increasing the prioritization?

Here's a customer ticket related to needing better recommendations around batch deleting https://cockroachdb.zendesk.com/agent/tickets/5882

Some guidance on why and how to batch large writes would be great. For example, with Postgres you'd batch writes to avoid holding row-level locks on a huge number of rows for a long time, which would block other concurrent writes to those rows. By batching you reduce the max number of rows locked at any given time, and those locks are held for a shorter time-frame. I'm not sure if CRDB has similar behavior for large writes, but an explanation of this form would be great.

Since @rohany's change that adds crdb_internal_mvcc_timestamp, we can recommend this pattern:

[email protected]:55288/defaultdb> delete from t where crdb_internal_mvcc_timestamp < 1597173188127148000.0000000000 LIMIT 10000;

Very nice
Sent from my iPhone

On Aug 11, 2020, at 3:23 PM, Jordan Lewis notifications@github.com wrote:


Since @rohany's change that adds crdb_internal_mvcc_timestamp, we can recommend this pattern:

[email protected]:55288/defaultdb> delete from t where crdb_internal_mvcc_timestamp < 1597173188127148000.0000000000 LIMIT 10000;
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

Was this page helpful?
0 / 5 - 0 ratings