Closed inviscid closed 2 months ago
I found a similar open issue that might be relevant to your request: Tracking: Improvement for large datasets. This issue is still open and was last updated on April 15, 2024. It does not have any comments or a solution yet [1].
To address your feature request of adding a column count to the system.tables
table, you can follow the process for adding a new column to a system table in Databend. Here is a summarized version of the steps involved:
AddTableColumnInterpreter
with the context and plan.execute2
method to handle the addition of the column.For detailed implementation, you can refer to the code snippets provided in the source files:
This process ensures that the new column is added correctly and the table's metadata is updated accordingly.
To continue talking to Dosu, mention @dosu.
Summary
We frequently obtain table shape information from the system tables. Since the column count is not part of
system.tables
information, we must perform a sub-query count onsystem.columns
.This information is returned trivially fast in a Postgres/Greenplum environment but often takes 1.5 to 2 seconds to return in Databend (per table). By storing the column count in
system.tables
the sub-query can be eliminated and hopefully the table shape information can be returned sub-second.This is an example of the current query used to retrieve the table shape: