All Products
Search
Document Center

PolarDB:Query the storage usage of IMCI

Last Updated:Mar 30, 2026

Query the INFORMATION_SCHEMA.IMCI_INDEX_SPACE table to check how much storage your In-Memory Column Indexes (IMCIs) are using — at the table, database, or cluster level.

Supported versions

  • PolarDB for MySQL 8.0.1, revision version 8.0.1.1.44 or later

  • PolarDB for MySQL 8.0.2, revision version 8.0.2.2.25 or later

Query IMCI storage usage

Before running any query against INFORMATION_SCHEMA.IMCI_INDEX_SPACE, run the following statement to minimize metadata overhead and improve query performance:

SET IMCI_I_S_SKIP_DD_OPEN = ON;

Query by table

SELECT
  SCHEMA_NAME, TABLE_NAME, TOTAL_SPACE
FROM
  INFORMATION_SCHEMA.IMCI_INDEX_SPACE
WHERE SCHEMA_NAME = 'TEST' AND TABLE_NAME = 'TEST';

Query by database

SELECT
  SCHEMA_NAME, SUM(TOTAL_SPACE)
FROM
  INFORMATION_SCHEMA.IMCI_INDEX_SPACE
WHERE SCHEMA_NAME = 'TEST';

Query all IMCIs in the cluster

SELECT
  SUM(TOTAL_SPACE)
FROM
  INFORMATION_SCHEMA.IMCI_INDEX_SPACE;

Column reference

INFORMATION_SCHEMA.IMCI_INDEX_SPACE returns the following columns:

Column Description
SCHEMA_NAME Name of the database.
TABLE_NAME Name of the table.
TABLE_ID ID of the table.
INDEX_ID ID of the IMCI.
TOTAL_SPACE Total storage used by all IMCI files. Unit: bytes.
INDEX_META_SPACE Storage used by the IMCI metadata file. Unit: bytes.
NCI_SPACE Storage used by the mapping file that defines the mapping between the IMCI and the rowstore primary keys. Unit: bytes.
PACK_DATA_SPACE Storage used by the IMCI pack file. Unit: bytes.
FULL_PACKMETA_SPACE Storage used by the full pack metadata file. Unit: bytes.
PARTIAL_PACKMETA_SPACE Storage used by the partial pack metadata file. Unit: bytes.
MASK_SPACE Storage used by the visibility tag file. Unit: bytes.

Key metrics for capacity planning

PACK_DATA_SPACE and NCI_SPACE are the primary indicators of IMCI storage consumption:

  • PACK_DATA_SPACE: Storage used by the IMCI pack file. This is a key metric for measuring IMCI storage usage.

  • NCI_SPACE: Storage used by the mapping file that defines the mapping between the IMCI and the rowstore primary keys. This is a key metric for measuring IMCI storage usage.

Monitor these two columns to assess actual IMCI footprint and plan capacity.