OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.6.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.6.0
    iconOceanBase Database
    SQL - V 4.6.0
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    oceanbase.CDB_TAB_COL_STATISTICS

    Last Updated:2026-05-07 11:26:24  Updated
    share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    share

    Note

    This view is available starting with V4.0.0.

    Purpose

    This view displays the column statistics and histogram information of all tenants in the sys tenant.

    Columns

    Column Type Nullable Description
    CON_ID bigint(20) NO The tenant ID.
    OWNER varchar(128) NO The user to whom the column belongs.
    TABLE_NAME varchar(128) NO The name of the table to which the column belongs.
    COLUMN_NAME varchar(128) NO The column name.
    NUM_DISTINCT bigint(20) NO The number of distinct values in the column.
    LOW_VALUE varchar(128) NO The minimum value of the column.
    HIGH_VALUE varchar(128) NO The maximum value of the column.
    DENSITY bigint(21) NO The density of the column.
    NUM_NULLS bigint(20) NO The number of NULL values in the column.
    NUM_BUCKETS bigint(20) NO The number of buckets in the histogram of the column.
    LAST_ANALYZED date NO The time when the statistics were last analyzed.
    SAMPLE_SIZE bigint(20) NO The sampling size when the statistics were analyzed.
    GLOBAL_STATS varchar(3) NO
    • YES: indicates that the statistics are directly collected or incrementally maintained.
    • NO: other cases.
    USER_STATS varchar(3) NO Indicates whether the partition statistics are user-defined.
    NOTES varchar(80) NO Records some additional attributes.
    AVG_COL_LEN bigint(21) NO The average length of the column.
    HISTOGRAM varchar(15) NO The histogram type.
    SCOPE varchar(7) NO The scope of the statistics.

    Sample query

    In the sys tenant, query the column statistics and histogram information of the T2_M_LR table in the tenant with ID 1004.

    obclient [oceanbase]> SELECT * FROM oceanbase.CDB_TAB_COL_STATISTICS WHERE CON_ID=1004 AND TABLE_NAME='T2_M_LR'\G
    

    The query result is as follows:

    *************************** 1. row ***************************
           CON_ID: 1004
            OWNER: SYS
       TABLE_NAME: T2_M_LR
      COLUMN_NAME: COL1
     NUM_DISTINCT: 0
        LOW_VALUE: NULL
       HIGH_VALUE: NULL
          DENSITY: 0
        NUM_NULLS: 0
      NUM_BUCKETS: 0
    LAST_ANALYZED: 2025-03-12
      SAMPLE_SIZE: 0
     GLOBAL_STATS: NO
       USER_STATS: NO
            NOTES: NULL
      AVG_COL_LEN: 0
        HISTOGRAM: NULL
            SCOPE: NULL
    *************************** 2. row ***************************
           CON_ID: 1004
            OWNER: SYS
       TABLE_NAME: T2_M_LR
      COLUMN_NAME: COL2
     NUM_DISTINCT: 0
        LOW_VALUE: NULL
       HIGH_VALUE: NULL
          DENSITY: 0
        NUM_NULLS: 0
      NUM_BUCKETS: 0
    LAST_ANALYZED: 2025-03-12
      SAMPLE_SIZE: 0
     GLOBAL_STATS: NO
       USER_STATS: NO
            NOTES: NULL
      AVG_COL_LEN: 0
        HISTOGRAM: NULL
            SCOPE: NULL
    2 rows in set
    

    References

    • View statistics of the current tenant: DBA_TAB_COL_STATISTICS

    • For more information about how to collect statistics, see the following topics:

      • Manually collect statistics

      • Automatically collect statistics

    Previous topic

    oceanbase.CDB_SUBPARTITION_TEMPLATES
    Last

    Next topic

    oceanbase.CDB_TAB_COLS
    Next
    What is on this page
    Purpose
    Columns
    Sample query
    References