Count Table Rows
count_table_rowsCount rows in a Magento table to estimate its size safely before executing select queries, using approximate or exact methods.
Instructions
Returns approximate or exact row count for a single table. Safer than SELECT * on large Magento tables. Use before execute_select_query to gauge table size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Magento database table name (e.g. sales_order, catalog_product_entity). | |
| profile | No | Override the MAGENTO_SQL_PROFILE env var for this call only. Use list_connection_profiles to see available names. | |
| magentoRoot | No | Absolute path to the Magento root (must contain app/etc/env.php). Defaults to MAGENTO_ROOT env var or auto-discovery. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| rows | Yes | ||
| sampled | No | ||
| rowCount | Yes | ||
| truncated | No |