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

    GV$SQL_WORKAREA

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

    folded

    share

    Note

    This view is available starting with V2.2.77.

    Purpose

    This view displays the workarea statistics for all operators managed by SQL automatic memory management.

    Columns

    Column Type Nullable Description
    ADDRESS varbinary(8) NO The handle address corresponding to the SQL statement. This column is not specified.
    HASH_VALUE bigint(0) NO The hash value of the statement.
    DB_ID bigint(20) NO The database ID of the connection associated with the SQL request.

    Note

    • For V4.3.x, this column is available starting with V4.3.1.
    • For V4.2.x, this column is available starting with V4.2.3.
    SQL_ID varchar(32) NO The unique identifier for the SQL statement.
    CHILD_NUMBER bigint(0) NO The number of cursors.
    WORKAREA_ADDRESS varbinary(8) NO The workarea address.
    OPERATION_TYPE varchar(40) NO The type of the workarea operator, such as Sort, Hash Join, and Group by.
    OPERATION_ID bigint(20) NO The unique identifier for the operator in the plan tree.
    POLICY varchar(10) NO The workarea strategy. Valid values:
    • MANUAL
    • AUTO
    ESTIMATED_OPTIMAL_SIZE bigint(20) NO The estimated memory size required for optimal execution of the operator, in bytes.
    ESTIMATED_ONEPASS_SIZE bigint(20) NO The estimated memory size required for one-pass execution of the operator, in bytes.
    LAST_MEMORY_USED bigint(20) NO The amount of memory used by the cursor in the last execution, in bytes.
    LAST_EXECUTION varchar(10) NO The execution mode used in the last execution: optimal, one pass, or multi passes.
    LAST_DEGREE bigint(20) NO The parallelism degree used in the last execution.
    TOTAL_EXECUTIONS bigint(20) NO The total number of times the workarea was used.
    OPTIMAL_EXECUTIONS bigint(20) NO The number of times the workarea was used in optimal mode.
    ONEPASS_EXECUTIONS bigint(20) NO The number of times the workarea was used in one-pass mode.
    MULTIPASSES_EXECUTIONS bigint(20) NO The number of times the workarea was used in multi-pass mode.
    ACTIVE_TIME bigint(20) NO The average active time of the workarea, in seconds.
    MAX_TEMPSEG_SIZE bigint(20) NO The maximum temporary disk space used by the workarea, in bytes. If this column is NULL, no temporary space was used.
    LAST_TEMPSEG_SIZE bigint(20) NO The temporary disk space used by the workarea in the last execution. If this column is NULL, no temporary space was used.
    CON_ID bigint(20) NO The tenant ID.
    SVR_IP varchar(46) NO The IP address of the server.
    SVR_PORT bigint(20) NO The port number of the server.

    Sample query

    Query the workarea statistics for all operators managed by SQL automatic memory management on all OBServer nodes.

    obclient [oceanbase]> SELECT * FROM oceanbase.GV$SQL_WORKAREA LIMIT 1\G
    

    The query result is as follows:

    *************************** 1. row ***************************
                   ADDRESS: NULL
                HASH_VALUE: NULL
                     DB_ID: 201001
                    SQL_ID: DC0ECB93D5AA3E26623B4E6CF05B6E74
              CHILD_NUMBER: 337
          WORKAREA_ADDRESS: NULL
            OPERATION_TYPE: PHY_HASH_JOIN
              OPERATION_ID: 1
                    POLICY: AUTO
    ESTIMATED_OPTIMAL_SIZE: 2604288
    ESTIMATED_ONEPASS_SIZE: 412725
          LAST_MEMORY_USED: 109388
            LAST_EXECUTION: OPTIMAL
               LAST_DEGREE: 1
          TOTAL_EXECUTIONS: 17
        OPTIMAL_EXECUTIONS: 17
        ONEPASS_EXECUTIONS: 0
    MULTIPASSES_EXECUTIONS: 0
               ACTIVE_TIME: 460
          MAX_TEMPSEG_SIZE: 0
         LAST_TEMPSEG_SIZE: 0
                    CON_ID: 1002
                    SVR_IP: 172.xx.xx.xx
                  SVR_PORT: 2882
    1 row in set
    

    Previous topic

    GV$SQL_PLAN_MONITOR
    Last

    Next topic

    GV$SQL_WORKAREA_ACTIVE
    Next
    What is on this page
    Purpose
    Columns
    Sample query