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.3.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.3.0
    iconOceanBase Database
    SQL - V 4.3.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

    Hints related to access path

    Last Updated:2026-04-15 08:30:01  Updated
    Share
    What is on this page
    INDEX hint
    FULL hint
    USE_COLUMN_TABLE
    Syntax
    Examples
    NO_USE_COLUMN_TABLE
    Syntax
    Examples

    folded

    Share

    Hints related to access path are INDEX, FULL, USE_COLUMN_TABLE, and NO_USE_COLUMN_TABLE.

    INDEX hint

    The INDEX hint instructs the optimizer to use an index scan for the specified table. You can use INDEX hints for indexes that are based on functions, domains, B-trees, bitmaps, or bitmap joins.

    The syntax of the INDEX hint is as follows:

    /*+ INDEX ( [ @queryblock ] tablespec [ indexspec [ indexspec ]... ] ) */
    

    The behavior of a hint depends on the indexspec specification:

    • If an INDEX hint specifies a single available index, the database performs a scan on this index. The optimizer does not consider a full table scan or a scan on another index on the table.

    • If an INDEX hint specifies a list of available indexes, the optimizer considers the cost of a scan on each index in the list and then performs an index scan with the lowest cost. The database chooses to scan multiple indexes from this list and merge the results, if such an access path has the lowest cost. The database does not perform a full table scan or a scan on an index that is not in the list.

    • If an INDEX hint does not specify a specific index, the optimizer considers the cost of a scan on each available index on the table and then performs an index scan with the lowest cost. The database chooses to scan multiple indexes and merge the results, if such an access path has the lowest cost. The optimizer does not consider a full table scan.

    Here is an example of the INDEX hint:

    SELECT /*+ INDEX (employees emp_department_ix)*/ employee_id, department_id
    FROM employees
    WHERE department_id > 50;
    

    FULL hint

    The FULL hint instructs the optimizer to perform a full table scan for the specified table.

    The syntax of the FULL hint is as follows:

    /*+ FULL ( [ @queryblock ] tablespec ) */
    

    Here is an example of the FULL hint:

    SELECT /*+ FULL(e) */ employee_id, last_name
    FROM hr.employees e
    WHERE last_name LIKE :al;
    

    In the preceding example, the database performs a full table scan on the employees table to execute this statement, even if an index is defined on the last_name column that is made available by the condition in the WHERE clause.

    In the FROM clause, the EMPLOYEES table has an alias e, so the hint must refer to the table by its alias instead of its name. Do not refer to schema names in the hint even if they are specified in the FROM clause.

    USE_COLUMN_TABLE

    The USE_COLUMN_TABLE hint specifies to perform columnar scan for the specified table object. The USE_COLUMN_TABLE hint is invalid for a table for which columnar storage is not enabled.

    Syntax

    /*+ USE_COLUMN_TABLE ( [ @ qb_name ] tablespec) */
    

    Examples

    create table t(c1 int, c2 int ,c3 int)
    with column group (all columns, each column);
    
    explain basic select /*+USE_COLUMN_TABLE(t)*/ * from t;
    +------------------------------------------------------------------+
    | Query Plan                                                       |
    +------------------------------------------------------------------+
    | ================================                                 |
    | |ID|OPERATOR              |NAME|                                 |
    | --------------------------------                                 |
    | |0 |COLUMN TABLE FULL SCAN|t   |                                 |
    | ================================                                 |
    | Outputs & filters:                                               |
    | -------------------------------------                            |
    |   0 - output([t.c1], [t.c2], [t.c3]), filter(nil), rowset=16     |
    |       access([t.c1], [t.c2], [t.c3]), partitions(p0)             |
    |       is_index_back=false, is_global_index=false,                |
    |       range_key([t.__pk_increment]), range(MIN ; MAX)always true |
    +------------------------------------------------------------------+
    

    NO_USE_COLUMN_TABLE

    The NO_USE_COLUMN_TABLE hint specifies to forbid columnar scan for the specified table object.

    Syntax

    /*+ NO_USE_COLUMN_TABLE ( [ @ qb_name ] tablespec ) */
    

    Examples

    create table t(c1 int, c2 int ,c3 int)
    with column group (all columns, each column);
    
    explain basic select /*+NO_USE_COLUMN_TABLE(t)*/ * from t;
    +------------------------------------------------------------------+
    | Query Plan                                                       |
    +------------------------------------------------------------------+
    | =========================                                        |
    | |ID|OPERATOR       |NAME|                                        |
    | -------------------------                                        |
    | |0 |TABLE FULL SCAN|t   |                                        |
    | =========================                                        |
    | Outputs & filters:                                               |
    | -------------------------------------                            |
    |   0 - output([t.c1], [t.c2], [t.c3]), filter(nil), rowset=16     |
    |       access([t.c1], [t.c2], [t.c3]), partitions(p0)             |
    |       is_index_back=false, is_global_index=false,                |
    |       range_key([t.__pk_increment]), range(MIN ; MAX)always true |
    +------------------------------------------------------------------+
    

    Previous topic

    Overview
    Last

    Next topic

    Hints related to join orders
    Next
    What is on this page
    INDEX hint
    FULL hint
    USE_COLUMN_TABLE
    Syntax
    Examples
    NO_USE_COLUMN_TABLE
    Syntax
    Examples