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

refactor: add SchemaApi::get_table_in_db #16582

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Oct 10, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

refactor: add SchemaApi::get_table_in_db

In cases where the database-id is already known, use this method to
get a table as replacement of get_table(). get_table() re-fetch
database-id by database-name, thus leads to additional unnecessary delay
and potential consistency issues, because a database may already be
renamed, and using the original database-name just gets the wrong
database instance.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Refactoring

Related Issues


This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Oct 10, 2024
In cases where the `database-id` is already known, use this method to
get a table as replacement of `get_table()`. `get_table()` re-fetch
database-id by database-name, thus leads to additional unnecessary delay
and potential consistency issues, because a database may already be
renamed, and using the original database-name just gets the wrong
database instance.
@drmingdrmer drmingdrmer marked this pull request as ready for review October 10, 2024 01:51
@drmingdrmer drmingdrmer merged commit b7acf5c into databendlabs:main Oct 10, 2024
74 checks passed
@drmingdrmer drmingdrmer deleted the 159-get-table branch October 10, 2024 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant