统计表行数
dm_table_countGet the row count of a table using exact COUNT(*) by default, or use statistics-based estimates for large tables when exact counts are too costly.
Instructions
返回一张表的行数。默认执行精确 COUNT(*)。注意:达梦 ALL_TABLES.NUM_ROWS 来自统计信息,本库多数表未收集统计信息,该值通常为 NULL —— 所以不要拿 dm_list_tables 里的 NUM_ROWS 当真实行数,要用本工具。大表可以把 exact 设为 false,只读取统计估算值(可能不可用)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exact | No | 是否执行精确 COUNT(*)。默认 true;大表可设 false 只取统计信息估算值 | |
| owner | No | 模式名,table 未带前缀时使用 | |
| table | Yes | 表名,支持 "TABLE" 或 "SCHEMA.TABLE",不区分大小写 | |
| response_format | No | 输出格式 | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| exactCount | Yes | ||
| lastAnalyzed | Yes | ||
| estimatedRows | Yes |