-
Notifications
You must be signed in to change notification settings - Fork 332
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
Alter database option #4394
Comments
I'm interested in this issue. I guess we can implement this feature with the following high level steps.
|
Cool. @NiwakaDev
I recommend designing the statement to use
Yes, you have to implement a procedure, which needs to change the database metadata. I am not quite sure if we need to alter all the inherited table options too, because:
What do you think? @evenyag @fengjiachun |
Looks good.
Should table options have higher priority than database options? |
I think My idea is that Right now, we don't have a |
Aren't there any situations where we want to prioritize the table ttl even if the database ttl is smaller? |
I think the region's TTL option should have higher priority. It overwrites the database's TTL if we set the table TTL. |
Of course, the table's custom TTL must be prioritized over the database TTL. However, the table TTL is set to the database TTL when creating a table without the greptimedb/src/operator/src/statement/ddl.rs Line 1501 in b81d3a2
We don't know if a table is inherited or custom the TTL at all. There is one solution is that we can add a flag to figure out that the table TTL is Another choice is as @fengjiachun said, let's not change the region's TTL but just the database options. I prefer the second solution. It's much simpler, and altering many tables is expensive. |
Even if we choose the choice, I think we still need a flag indicates whether or not the table is inherited. I guess that adding the flag isn't expensive. When the region GC works, if the flag is set, we prioritize the table TTL. Otherwise, we select the database TTL from the |
Agree, let's add a flag to indicate whether or not the table option is inherited. Maybe it's an option set like
Sound good. Then it doesn't need to alter all the table options, but just retrieving the database TTL while gc. |
I'll implement this feature with the following high level steps:
|
Sorry for the delay in implementing this. I'll submit a first PR next week. |
What problem does the new feature solve?
Since v0.8, GreptimeDB supports database TTL just like:
which means all the tables in this database will inherit this option if they don't have their own TTL setting.
It does not support alerting the options after they are created.
What does the feature do?
Alter the database options:
Implementation challenges
No response
The text was updated successfully, but these errors were encountered: