system.indexes
引入: v1.1.50
包含有关已创建的聚合索引的信息。
另请参阅: SHOW INDEXES
CREATE TABLE t1(a int,b int);
CREATE AGGREGATING INDEX idx1 AS SELECT SUM(a), b FROM default.t1 WHERE b > 3 GROUP BY b;
SELECT * FROM system.indexes;
+----------+-------------+------------------------------------------------------------+----------------------------+
| name | type | definition | created_on |
+----------+-------------+------------------------------------------------------------+----------------------------+
| test_idx | AGGREGATING | SELECT b, SUM(a) FROM default.t1 WHERE (b > 3) GROUP BY b | 2023-05-17 11:53:54.474377 |
+----------+-------------+------------------------------------------------------------+----------------------------+