tableStats
tableStatsInspect table size and activity statistics, including row estimates, storage, dead tuples, maintenance times, and scan counters.
Instructions
Inspect operational size and activity statistics for one known table: estimated/live rows, storage, dead tuples, maintenance times and scan counters. For fields, keys and constraints, use describeTable; available statistics depend on engine and privileges.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| schema | No | ||
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error encountered while loading table statistics; other fields may be partial when set. | |
| found | Yes | True when the requested object or path was found. | |
| table | No | ||
| blocks | No | Engine-reported allocated block count, when available. | |
| schema | No | ||
| tupDel | No | Number of deleted tuples recorded by engine statistics. | |
| tupIns | No | Number of inserted tuples recorded by engine statistics. | |
| tupUpd | No | Number of updated tuples recorded by engine statistics. | |
| idxScan | No | Number of index scans recorded for the table. | |
| relkind | No | Engine-specific relation kind for the table or view. | |
| seqScan | No | Number of sequential scans recorded for the table. | |
| avgRowLen | No | Average row length reported by optimizer statistics, when available. | |
| temporary | No | Whether the table is temporary, when the engine reports it. | |
| userStats | No | Oracle flag indicating whether user-defined statistics are present. | |
| chainCount | No | Oracle chained row count, when available. | |
| createDate | No | SQL Server object creation timestamp, when available. | |
| deadTuples | No | Estimated number of dead tuples or obsolete row versions. | |
| lastVacuum | No | Timestamp of the last manual vacuum, when available. | |
| liveTuples | No | Estimated number of live tuples or rows. | |
| modifyDate | No | SQL Server object modification timestamp, when available. | |
| sampleSize | No | Sample size used for optimizer statistics, when available. | |
| seqTupRead | No | Number of tuples read by sequential scans. | |
| compression | No | Compression setting reported for the table, when available. | |
| emptyBlocks | No | Engine-reported empty block count, when available. | |
| globalStats | No | Oracle flag indicating whether global statistics are present. | |
| idxTupFetch | No | Number of table tuples fetched through this index, when available. | |
| isFiletable | No | SQL Server flag indicating a FileTable. | |
| lastAnalyze | No | Timestamp of the last manual analyze/statistics collection, when available. | |
| partitioned | No | Whether the table is partitioned, when the engine reports it. | |
| deadTuplePct | No | Approximate percentage of dead tuples among total tuples. | |
| lastAnalyzed | No | Timestamp when database optimizer statistics were last collected, when available. | |
| segmentBytes | No | Oracle segment size in bytes, when segment metadata is accessible. | |
| estimatedRows | No | Planner or catalog estimate of rows for this object or operation. | |
| lastAutovacuum | No | Timestamp of the last automatic vacuum, when available. | |
| tableSizeBytes | No | Storage used by the table heap or base data, in bytes. | |
| toastSizeBytes | No | PostgreSQL TOAST storage used by the table, in bytes. | |
| totalSizeBytes | No | Total storage used by the table, indexes, and auxiliary storage, in bytes. | |
| lastAutoanalyze | No | Timestamp of the last automatic analyze/statistics collection, when available. | |
| indexesSizeBytes | No | Storage used by indexes on the table, in bytes. | |
| temporalTypeDesc | No | SQL Server temporal table type description. | |
| isMemoryOptimized | No | SQL Server flag indicating a memory-optimized table. | |
| segmentBytesError | No | Permission or lookup error encountered while reading segment size. |