云数据库 GaussDB-Scan方式的Hint:示例

时间:2023-11-01 16:19:21

示例

为了hint使用索引扫描,需要首先在表item的i_item_sk列上创建索引,名称为i。

create index i on item(i_item_sk);

示例中原语句使用如下hint:

explain select /*+ indexscan(item i) */ i_product_name product_name ...

该hint表示:item表使用索引i进行扫描。生成计划如下所示:

support.huaweicloud.com/usermanual-opengauss/opengauss_opti_0059.html