You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 058dfd3
Browse filesBrowse the repository at this point in the historyBrowse files
[opt](schema) Optimize tables schema scan status (apache#64933)
Optimize information_schema.tables status scan for large OlapTables.
Before this PR, FE always filled the full table status payload for
information_schema.tables, so even queries that only projected
lightweight columns such as UPDATE_TIME still paid the cost of
tablet-derived status fields.
This PR includes the following optimizations:
| Optimization | Description |
| --- | --- |
| Column pruning for table status RPC | BE passes the required
information_schema.tables columns to FE, and FE only fills requested
optional status fields. Lightweight queries can skip TABLE_ROWS,
DATA_LENGTH, AVG_ROW_LENGTH, and INDEX_LENGTH. |
| Single tablet-status traversal | TABLE_ROWS, DATA_LENGTH,
AVG_ROW_LENGTH, and INDEX_LENGTH are computed together when any of them
is requested, avoiding repeated OlapTable tablet/replica traversal. |
This PR does not add a table-level cache for tablet-derived status
fields. The benchmark still shows the possible room for that future
optimization: the full status query remains slower than the
UPDATE_TIME-only query because it still needs to read tablet-derived
status, while the lightweight query can skip it completely.
Benchmark on a table with 3900 partitions and 21 buckets per partition,
about 81,900 tablets, workers=20, targetQps=100:
| Query | Before avgQps | After avgQps | Improvement | Notes |
| --- | ---: | ---: | ---: | --- |
| SHOW TABLE STATUS FROM regression_test_stress_load_usercase LIKE ... |
26.3 | 49.1 | +86.7% | Full status query. It still needs tablet-derived
status fields, but benefits from the single traversal optimization. |
| SELECT TABLE_NAME, UPDATE_TIME FROM information_schema.tables WHERE
TABLE_SCHEMA = ... | 29.3 | 92.2 | +214.7% | Lightweight projection. It
benefits from column pruning and skips tablet-derived status fields. |
0 commit comments