在oracle中使用hint可以调整SQL的执行计划,在postgresql可以使用如下的方法进行调整
使用set<option> to off/on;调整查询计划,参数如下:
enable_seqscan是否走全表扫描
enable_hashjoin是否允许走hash连接
enable_nestloop是否允许走nestloop连接
enable_mergejoin是否允许走合并连接
enable_tidscan是否允许走tid扫描(类似oracle中的按rowid访问)
enable_bitmapscan是否允许走bitmap扫描
enable_hashagg是否允许走hash聚集(也就是做group by时)
enable_indexscan是否允许走索引
enable_sort是否允许走排序
constraint_exclusion是否允许走分区