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
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    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
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    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.DBA_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 tables in the current tenant.

    Columns

    Column
    Type
    Nullable
    Description
    OWNER varchar(128) NO The user to which the column belongs.
    TABLE_NAME varchar(128) NO The name of the table to which the column belongs.
    COLUMN_NAME varchar(128) NO The name of the column.
    NUM_DISTINCT decimal(10,0) NO The number of distinct values in the column.
    LOW_VALUE varchar(128) NO The minimum value in the column.
    HIGH_VALUE varchar(128) NO The maximum value in the column.
    DENSITY decimal(10,0) NO The density of the column.
    NUM_NULLS decimal(10,0) NO The number of NULL values in the column.
    NUM_BUCKETS decimal(10,0) NO The number of buckets in the column histogram.
    LAST_ANALYZED datetime(6) NO The time when the last analysis was performed.
    SAMPLE_SIZE decimal(10,0) NO The sampling size during the analysis.
    GLOBAL_STATS varchar(3) NO
    • YES: Indicates that the statistics were 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 decimal(10,0) NO The average length of the column.
    HISTOGRAM varchar(15) NO The type of histogram.
    SCOPE varchar(7) NO The validity scope of the statistics.

    Sample query

    In the sys tenant, query the column statistics and histogram information of the t_subpart table in the current tenant.

    obclient [oceanbase]> SELECT OWNER, TABLE_NAME, COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS, NUM_BUCKETS, SAMPLE_SIZE, AVG_COL_LEN, HISTOGRAM FROM oceanbase.DBA_TAB_COL_STATISTICS WHERE TABLE_NAME ='t_subpart' ORDER BY 1, 2, 3;
    

    The query result is as follows:

    +-------+------------+-------------+--------------+-----------+------------+--------------+-----------+-------------+-------------+-------------+-----------+
    | OWNER | TABLE_NAME | COLUMN_NAME | NUM_DISTINCT | LOW_VALUE | HIGH_VALUE | DENSITY      | NUM_NULLS | NUM_BUCKETS | SAMPLE_SIZE | AVG_COL_LEN | HISTOGRAM |
    +-------+------------+-------------+--------------+-----------+------------+--------------+-----------+-------------+-------------+-------------+-----------+
    | test  | t_subpart  | c1          |         9800 | 0         | 9999       | 0.0001020408 |         0 |           5 |       10000 |          20 | HYBRID    |
    | test  | t_subpart  | c2          |         1012 | 0         | 999        | 0.0009881423 |         0 |           5 |       10000 |          20 | HYBRID    |
    | test  | t_subpart  | c3          |         2030 | 0         | 1999       | 0.0004926108 |         0 |           5 |       10000 |          20 | HYBRID    |
    +-------+------------+-------------+--------------+-----------+------------+--------------+-----------+-------------+-------------+-------------+-----------+
    3 rows in set
    

    References

    • View statistics of all tenants: CDB_TAB_COL_STATISTICS

    • View column statistics at the table level: DBA_TAB_STATISTICS

    • View column statistics at the partition level: DBA_PART_COL_STATISTICS

    • View column statistics at the subpartition level: DBA_SUBPART_COL_STATISTICS

    • View histogram statistics at the table level: DBA_TAB_HISTOGRAMS

    • View histogram statistics at the partition level: DBA_PART_HISTOGRAMS

    • View histogram statistics at the subpartition level: DBA_SUBPART_HISTOGRAMS

    • View index statistics: DBA_IND_STATISTICS

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

      • Manually collect statistics

      • Automatically collect statistics

    Previous topic

    oceanbase.DBA_SUBPARTITION_TEMPLATES
    Last

    Next topic

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