mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
docs(clickhouse): add SQL to calculate average uncompressed row size per table and close code fence
This commit is contained in:
@@ -66,4 +66,21 @@ ORDER BY elapsed DESC;
|
||||
|
||||
```sql
|
||||
KILL QUERY WHERE query_id = 'your_query_id';
|
||||
```
|
||||
|
||||
|
||||
#### Get size of avg row in bytes by table.
|
||||
|
||||
```
|
||||
SELECT
|
||||
c.table,
|
||||
sum(c.data_uncompressed_bytes) AS total_uncompressed_bytes,
|
||||
t.total_rows,
|
||||
sum(c.data_uncompressed_bytes) / t.total_rows AS avg_uncompressed_row_size_bytes
|
||||
FROM system.columns c
|
||||
JOIN system.tables t
|
||||
ON c.database = t.database AND c.table = t.name
|
||||
WHERE c.database = 'oneuptime'
|
||||
GROUP BY c.table, t.total_rows
|
||||
ORDER BY avg_uncompressed_row_size_bytes DESC;
|
||||
```
|
||||
Reference in New Issue
Block a user