-
Notifications
You must be signed in to change notification settings - Fork 329
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
Refactor: using "id" (instead of its "name") to find the table #1525
Comments
The table engine also has similar issues. Actually, we should use the table id to access the table. greptimedb/src/table/src/engine.rs Lines 88 to 105 in 6fe117d
|
The table name to table id transform must be done at catalog level, because the users only have the table name. After that, all the references to the tables should use table ids. |
greptimedb/src/catalog/src/local/memory.rs Lines 39 to 43 in 172febb
greptimedb/src/catalog/src/lib.rs Lines 95 to 100 in 172febb
Many places need to look up tables using This way, the requests sent to the datanode can include only the |
@DevilExileSu For |
@MichaelScofield We could retrieve the table id from TableRef. If we find out the TableRef from the catalog via Once #1869 is done, I think we don't need to send |
Yes, I think that |
@MichaelScofield @killme2008 If you don't mind, I would like to give it a try. |
@killme2008 are you working on this? |
Now we are fully turned to region server, no table name involved in read and write other than necessary table finding for user facing interface. I think this issue is no longer valid. |
What type of enhancement is this?
Tech debt reduction
What does the enhancement do?
Now we are using table names to find the tables in catalog, which could cause potential bugs after the table got renamed.
On the other hand, the table id is globally unique for each table, we should use that as far as possible.
Implementation challenges
There are too many places we are using table names to find them. Some places could be changed to table ids, some couldn't(and shouldn't). How to best recognize that and set a refactoring guideline is very challenging I think.
The text was updated successfully, but these errors were encountered: