mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-22 07:50:38 +00:00
* feat: adds index size to region statistics * feat: adds the number of rows for region statistics * test: adds sqlness test for region_statistics * fix: test
26 lines
640 B
SQL
26 lines
640 B
SQL
USE public;
|
|
|
|
CREATE TABLE test (
|
|
a int primary key,
|
|
b string,
|
|
ts timestamp time index,
|
|
) PARTITION ON COLUMNS (a) (
|
|
a < 10,
|
|
a >= 10 AND a < 20,
|
|
a >= 20,
|
|
);
|
|
|
|
|
|
INSERT INTO test VALUES
|
|
(1, 'a', 1),
|
|
(11, 'b', 11),
|
|
(21, 'c', 21);
|
|
|
|
-- SQLNESS SLEEP 11s
|
|
-- FIXME(dennis): we need to wait the datanode reporting stats info to metasrv.
|
|
SELECT SUM(region_rows), SUM(disk_size), SUM(sst_size), SUM(index_size)
|
|
FROM INFORMATION_SCHEMA.REGION_STATISTICS WHERE table_id
|
|
IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 'test' and table_schema = 'public');
|
|
|
|
DROP TABLE test;
|