OceanBase logo

OceanBase

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

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

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

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.4.2

    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.4.2
    iconOceanBase Database
    SQL - V 4.4.2
    SQL
    KV
    • 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_PART_COL_STATISTICS

    Last Updated:2026-04-02 06:23:58  Updated
    share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    share

    Note

    This view is introduced since OceanBase Database V4.0.0.

    Purpose

    The oceanbase.DBA_PART_COL_STATISTICS view displays the column statistics and histograms of all partitioned tables of the database.

    Columns

    Column Type Nullable? Description
    OWNER varchar(128) NO The owner of the partitioned table.
    TABLE_NAME varchar(128) NO The name of the table.
    PARTITION_NAME varchar(128) NO The name of the table partition.
    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. If you can create a histogram on the COLUMN_NAME column, this column shows the selectivity of the values with zero or one occurrence in the histogram. It does not represent the selectivity of values with two or more occurrences. If COLUMN_NAME is not available on the histogram, the value of this column is 1 or NUM_DISTINCT.
    NUM_NULLS decimal(10,0) NO The number of NULLs in the column.
    NUM_BUCKETS decimal(10,0) NO The number of buckets in the histogram of the column.
    LAST_ANALYZED datetime(6) NO The date when column chromatography was analyzed the last time.
    SAMPLE_SIZE decimal(10,0) NO The sample size for column chromatography analysis.
    GLOBAL_STATS varchar(3) NO Indicates whether the statistics have been collected. Valid values:
  • YES: indicates that statistics have been collected.
  • NO: indicates that statistics have been summarized from subpartitions or have not been collected.
  • NOTES varchar(80) NO The additional properties that describe the statistics. Valid values:
  • INCREMENTAL: indicates that the column has a summary.
  • INCREMENTAL(HLL): indicates that the column has a summary in the HyperLogLog (HLL) format.
  • INCREMENTAL(SAMPLING): indicates that the column has a summary in an adaptive sampling format.
    You can check this column to determine whether the summary of the adaptive sampling format has been completely eliminated and properly cleared.
  • AVG_COL_LEN decimal(10,0) NO The average column length, in bytes.
    HISTOGRAM varchar(15) NO The type of the histogram. Valid values:
  • NONE
  • FREQUENCY
  • HEIGHT BALANCED
  • HYBRID
  • TOP-FREQUENCY
  • Sample query

    Query the column statistics and histogram information of the first-level partitions of the partitioned table t_subpart in the current tenant.

    obclient [oceanbase]> SELECT * FROM oceanbase.DBA_PART_COL_STATISTICS WHERE TABLE_NAME='t_subpart';
    

    The query result is as follows:

    +-------+------------+----------------+-------------+--------------+-----------+------------+--------------+-----------+-------------+----------------------------+-------------+--------------+------------+-------+-------------+-----------+
    | OWNER | TABLE_NAME | PARTITION_NAME | COLUMN_NAME | NUM_DISTINCT | LOW_VALUE | HIGH_VALUE | DENSITY      | NUM_NULLS | NUM_BUCKETS | LAST_ANALYZED              | SAMPLE_SIZE | GLOBAL_STATS | USER_STATS | NOTES | AVG_COL_LEN | HISTOGRAM |
    +-------+------------+----------------+-------------+--------------+-----------+------------+--------------+-----------+-------------+----------------------------+-------------+--------------+------------+-------+-------------+-----------+
    | test  | t_subpart  | p0             | c1          |         3540 | 0         | 9999       | 0.0002824859 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3334 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p0             | c2          |         1012 | 0         | 999        | 0.0009881423 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3334 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p0             | c3          |         2030 | 0         | 1999       | 0.0004926108 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3334 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p1             | c1          |         3308 | 1         | 9997       | 0.0003022975 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3333 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p1             | c2          |         1012 | 0         | 999        | 0.0009881423 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3333 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p1             | c3          |         2030 | 0         | 1999       | 0.0004926108 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3333 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p2             | c1          |         3230 | 2         | 9998       | 0.0003095975 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3333 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p2             | c2          |         1012 | 0         | 999        | 0.0009881423 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3333 | NO           | NO         | NULL  |          20 | HYBRID    |
    | test  | t_subpart  | p2             | c3          |         2030 | 0         | 1999       | 0.0004926108 |         0 |           5 | 2025-03-17 15:30:30.152256 |        3333 | NO           | NO         | NULL  |          20 | HYBRID    |
    +-------+------------+----------------+-------------+--------------+-----------+------------+--------------+-----------+-------------+----------------------------+-------------+--------------+------------+-------+-------------+-----------+
    9 rows in set
    

    References

    • Column statistics at the table level: DBA_TAB_STATISTICS

    • Column statistics at the global level: DBA_TAB_COL_STATISTICS

    • Column statistics at the subpartition level: DBA_SUBPART_COL_STATISTICS

    • Histogram statistics at the table level: DBA_TAB_HISTOGRAMS

    • Histogram statistics at the partition level: DBA_PART_HISTOGRAMS

    • Histogram statistics at the subpartition level: DBA_SUBPART_HISTOGRAMS

    • Index statistics: DBA_IND_STATISTICS

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

      • Manually collect statistics

      • Automatically collect statistics

    Previous topic

    oceanbase.DBA_OBJECTS
    Last

    Next topic

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