Skip to content

Commit ed21fe1

Browse files
committed
refactor: optimize query system.tables when query single table (databendlabs#16869)
optimize: optimize query system.tables when query single table
1 parent 5e2b4b8 commit ed21fe1

File tree

5 files changed

+250
-161
lines changed

5 files changed

+250
-161
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/query/service/tests/it/servers/http/http_query_handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ async fn test_simple_sql() -> Result<()> {
290290
assert_eq!(result.state, ExecuteStateKind::Succeeded, "{:?}", result);
291291
assert_eq!(result.next_uri, Some(final_uri.clone()), "{:?}", result);
292292
assert_eq!(result.data.len(), 10, "{:?}", result);
293-
assert_eq!(result.schema.len(), 22, "{:?}", result);
293+
assert_eq!(result.schema.len(), 23, "{:?}", result);
294294

295295
// get state
296296
let uri = result.stats_uri.unwrap();

src/query/service/tests/it/storages/testdata/columns_table.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ DB.Table: 'system'.'columns', Table: columns-table_id:1, ver:0, Engine: SystemCo
134134
| 'database_id' | 'system' | 'background_tasks' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
135135
| 'database_id' | 'system' | 'databases' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
136136
| 'database_id' | 'system' | 'databases_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
137+
| 'database_id' | 'system' | 'tables' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
138+
| 'database_id' | 'system' | 'tables_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
139+
| 'database_id' | 'system' | 'views' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
140+
| 'database_id' | 'system' | 'views_with_history' | 'UInt64' | 'BIGINT UNSIGNED' | '' | '' | 'NO' | '' |
137141
| 'databases' | 'system' | 'query_log' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |
138142
| 'datetime_precision' | 'information_schema' | 'columns' | 'NULL' | 'NULL' | '' | '' | 'NO' | '' |
139143
| 'default' | 'information_schema' | 'columns' | 'String' | 'VARCHAR' | '' | '' | 'NO' | '' |

src/query/storages/system/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ databend-common-config = { workspace = true }
2525
databend-common-exception = { workspace = true }
2626
databend-common-expression = { workspace = true }
2727
databend-common-functions = { workspace = true }
28+
databend-common-management = { workspace = true }
2829
databend-common-meta-api = { workspace = true }
2930
databend-common-meta-app = { workspace = true }
3031
databend-common-meta-types = { workspace = true }

0 commit comments

Comments
 (0)