databendlabs / databend

๐——๐—ฎ๐˜๐—ฎ, ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€ & ๐—”๐—œ. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.88k stars 752 forks source link

refactor: optimize query system.tables when query single table #16869

Closed TCeason closed 5 days ago

TCeason commented 6 days ago

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

Type of change


This change isโ€‚Reviewable

github-actions[bot] commented 6 days ago

Docker Image for PR

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

github-actions[bot] commented 6 days ago

ClickBench Report