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

feat: introduce system.tables_with_history #6435

Merged

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Jul 4, 2022

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

Summary

  • Introduce system.tables_with_history which contains dropped tables, and statement like show tables history .. depends on it
  • system.tables no longer contains dropped tables, so that for common statements like show tables (without history), call system$search_table, no longer accesse meta data of dropped tables (which might be rather slow)
    To be backward compatible:
    • schema of system.tables still contains the dropped_on column
      If it is not necessary, please let me know

NOTE:

Columns that not contained in the result set of show full tables …, will no longer be valid to be used in the where clause of show tables

e.g.

Hope this make sense, but if any concerns, please let me know.

Fixes #6352
Fixes #5858

————————

For @flaneur2020, hope the followings will not bring too much troubles, if anything is not acceptable or should be adjusted, pls let me know.

  • A new system table system.tables_with_history is added
    Its schema is the same of system.tables
  • show tables where table_name = … no longer works

@vercel
Copy link

vercel bot commented Jul 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
databend ✅ Ready (Inspect) Visit Preview Jul 4, 2022 at 0:43AM (UTC)

@dantengsky dantengsky changed the title Fix: introduce system.tables_with_history Feat: introduce system.tables_with_history Jul 4, 2022
@dantengsky dantengsky changed the title Feat: introduce system.tables_with_history feat(storage): introduce system.tables_with_history Jul 4, 2022
@dantengsky dantengsky changed the title feat(storage): introduce system.tables_with_history feat: introduce system.tables_with_history Jul 4, 2022
@Xuanwo Xuanwo changed the title feat: introduce system.tables_with_history feat: introduce system.tables_with_history Jul 4, 2022
@Xuanwo
Copy link
Member

Xuanwo commented Jul 4, 2022

There is a space at the start of the title, so our PR check always failed.

I'm fixed it now.

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Jul 4, 2022
@dantengsky
Copy link
Member Author

There is a space at the start of the title, so our PR check always failed.

Roger & thanks!

@BohuTANG
Copy link
Member

BohuTANG commented Jul 4, 2022

Please confirm that if show tables where table_name = “t” no longer valid affects the cloud platform or not. cc @Chasen-Zhang @flaneur2020

@BohuTANG
Copy link
Member

BohuTANG commented Jul 5, 2022

This CI failure is due to #6418 , it's in fixing, please ignore it :)

@Chasen-Zhang
Copy link
Member

Chasen-Zhang commented Jul 5, 2022

I haven't used show tables where table_name = … yet, But I did use show full tables from ${database}; will affect?
I'm using the call system$search_table search tables, This is ok in the test environment @dantengsky

@BohuTANG
Copy link
Member

BohuTANG commented Jul 5, 2022

Does this patch also fix #5858?

@BohuTANG BohuTANG merged commit fe18404 into databendlabs:main Jul 5, 2022
@dantengsky
Copy link
Member Author

show full tables from ${database}; will affect?

no effects for this statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

system.tables switch between list_tables and list_tables_history on-demand improve show tables performance.
4 participants