Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove recommendations to use crdb_internal.mvcc_timestamp in favor of ON UPDATE #11028

Closed
vy-ton opened this issue Aug 10, 2021 · 7 comments · Fixed by #12114
Closed

Remove recommendations to use crdb_internal.mvcc_timestamp in favor of ON UPDATE #11028

vy-ton opened this issue Aug 10, 2021 · 7 comments · Fixed by #12114
Assignees
Labels
C-doc-improvement P-1 High priority; must be done this release

Comments

@vy-ton
Copy link
Contributor

vy-ton commented Aug 10, 2021

Once we support ON UPDATE in hopefully 21.2, we should remove recommendations to use crdb_internal.mvcc_timestamp in favor of an ON UPDATE example.

Pages:

@vy-ton vy-ton added the P-1 High priority; must be done this release label Aug 10, 2021
@ericharmeling ericharmeling self-assigned this Aug 25, 2021
@ericharmeling ericharmeling added A-sql C-doc-improvement P-2 Normal priority; secondary task and removed P-1 High priority; must be done this release labels Aug 25, 2021
@vy-ton vy-ton added P-1 High priority; must be done this release and removed P-2 Normal priority; secondary task labels Sep 15, 2021
@vy-ton
Copy link
Contributor Author

vy-ton commented Oct 19, 2021

@ericharmeling Can you get to this in the next 2 weeks?

@ericharmeling
Copy link
Contributor

@ericharmeling Can you get to this in the next 2 weeks?

Yes! Will aim for EOW.

@vy-ton
Copy link
Contributor Author

vy-ton commented Oct 20, 2021

@mwang1026 What's the full story with crdb_internal_mvcc_timestamp? Do you think we should remove all mentions of it in our docs? Or strongly indicate that the internals could change that are unexpected for users?

@mwang1026
Copy link
Contributor

The latter is a must if we keep it around.

I think it'd be abrupt to remove it, if people rely on it, so I say we keep it for now with the major caveat

@ericharmeling
Copy link
Contributor

I've extended the note on crdb_internal_mvcc_timestamp: #12033

I'll leave this issue open to track a recommendation to use ON UPDATE for TTL instead.

@ericharmeling
Copy link
Contributor

@vy-ton

we should remove recommendations to use crdb_internal.mvcc_timestamp in favor of an ON UPDATE example.

Is the recommendation here to create a new TIMESTAMPTZ column with a now() ON UPDATE expression (e.g., ALTER TABLE ... ADD COLUMN last_updated TIMESTAMPTZ DEFAULT now() ON UPDATE now();), index the column, and then follow the indexed batch-delete pattern when deleting expired data?

@vy-ton
Copy link
Contributor Author

vy-ton commented Oct 21, 2021

I believe you want a hash-sharded index for the timestamptz column

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-doc-improvement P-1 High priority; must be done this release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants