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: optimize query system.tables when query single table #16869

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Nov 19, 2024

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

Summary

  1. moved SYSTEM_TABLES_ALLOW_LIST to src/meta/app/src/principal/user_grant.rs. I also refactored the get_visibility_checker function and added a new parameter: ignore_ownership.

  2. The purpose of this parameter is to optimize the performance of querying table information from system.tables. When this parameter is set, we can skip listing all ownerships and directly fetch a single ownership object, then perform only one get operation, thus reducing query time. In short, this change aims to improve the efficiency of querying table information from system.tables by avoiding unnecessary operations on the list of ownerships.

Tests

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

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@TCeason TCeason marked this pull request as draft November 19, 2024 05:20
@TCeason TCeason force-pushed the list_ownership branch 3 times, most recently from 58caec1 to 9e8ef8b Compare November 19, 2024 05:43
@TCeason TCeason changed the title optimize: optimize query system.tables when query single table refactor: optimize query system.tables when query single table Nov 19, 2024
@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Nov 19, 2024
@TCeason TCeason added the ci-benchmark-local Benchmark: run only local test label Nov 19, 2024
Copy link
Contributor

Docker Image for PR

  • tag: pr-16869-29d6190-1732001596

note: this image tag is only available for internal use,
please check the internal doc for more details.

Copy link
Contributor

@TCeason TCeason requested review from drmingdrmer and b41sh November 19, 2024 12:39
@TCeason TCeason marked this pull request as ready for review November 19, 2024 12:39
@TCeason TCeason requested a review from flaneur2020 November 19, 2024 12:39
Copy link
Member

@flaneur2020 flaneur2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 22 of 22 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @b41sh)

@BohuTANG BohuTANG merged commit 4af19cb into databendlabs:main Nov 19, 2024
81 checks passed
TCeason added a commit to TCeason/datafuse that referenced this pull request Dec 6, 2024
Metadata query performance has regressed in some cases.  Suggest reverting to resolve quickly and fix properly next week.
@TCeason TCeason mentioned this pull request Dec 6, 2024
11 tasks
TCeason added a commit to TCeason/datafuse that referenced this pull request Dec 6, 2024
Metadata query performance has regressed in some cases.  Suggest reverting to resolve quickly and fix properly next week.
github-merge-queue bot pushed a commit that referenced this pull request Dec 6, 2024
Metadata query performance has regressed in some cases.  Suggest reverting to resolve quickly and fix properly next week.
TCeason added a commit to TCeason/datafuse that referenced this pull request Dec 9, 2024
…endlabs#16869)

optimize: optimize query system.tables when query single table
TCeason added a commit to TCeason/datafuse that referenced this pull request Dec 9, 2024
…endlabs#16869)

optimize: optimize query system.tables when query single table
TCeason added a commit to TCeason/datafuse that referenced this pull request Dec 9, 2024
…endlabs#16869)

optimize: optimize query system.tables when query single table
TCeason added a commit to TCeason/datafuse that referenced this pull request Dec 10, 2024
…endlabs#16869)

optimize: optimize query system.tables when query single table
BohuTANG pushed a commit that referenced this pull request Dec 10, 2024
… (#17021)

optimize: optimize query system.tables when query single table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-benchmark-local Benchmark: run only local test 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.

5 participants