ux_hint_plan语法由/*+ hint[text] */定义,添加在explain关键字之前,具体语法如下:
/*+ hint[text] */ EXPLAIN sqlstament;
如果有多个hint条件,则各个hint[text]中间用空格隔开:
/*+ hint[text] hint[text] … */ EXPLAIN sqlstatment;
其中,“+”号表示该注释是一个hints,该加号必须立即跟在”/*”的后面,且中间不能有空格。
表?18.1.?hint提示语句
组 | 格式 | 描述 |
---|---|---|
扫描方式 | SeqScan(table) | 在表上进行顺序扫描 |
TidScan(table) | 在表上进行TID扫描 | |
IndexScan(table[ index...]) | 如果有指定的索引,则作为表扫描过程中使用的索引 | |
IndexOnlyScan(table[ index...]) | 仅适用索引浏览 | |
BitmapScan(table[ index...]) | 使用特定的索引对表进行位图扫描 | |
NoSeqScan(table) | 不对表进行顺序扫描 | |
NoTidScan(table) | 不对表进行TID扫描 | |
NoIndexScan(table)) | 不对表进行索引或者特定的索引扫描 | |
NoIndexOnlyScan(table) | 不用索引只扫描表 | |
NoBitmapScan(table) | 不对表进行位图扫描 | |
连接方式 | NestLoop(table table[ table...]) | 对包含特定表的连接做嵌套循环 |
HashJoin(table table[ table...]) | 对包含特定表的连接做哈希连接 | |
MergeJoin(table table[ table...]) | 对包含特定表的连接做联合连接 | |
NoNestLoop(table table[ table...]) | 对包含特定表的连接强制不做嵌套循环 | |
NoHashJoin(table table[ table...]) | 对包含特定表的连接强制不做哈希连接 | |
NoMergeJoin(table table[ table...]) | 对包含特定表的连接强制不做联合连接 | |
连接顺序 | Leading(table table[ table...]) | 按照特定的连接顺序合并 |
Leading(< join pair >) | 按照特定的连接顺序和方向连接。连接对是一组表,和/或 用括号括起来的可以组成嵌套结构的其他连接对 | |
行号校正 | Rows(table table[ table...] correction) | 更正联接结果中包含特殊表的行号。可用的校正方法有绝对(# n)、加(+ n)、减(- n)和乘(* n)。N 应该是strtod()可以读取的字符串 |
GUC | Set(GUC-param value) | 在计划程序运行时,需要设置GUC参数 |