SKIP_PROJS

指定要避免用于查询的表的投影。如果 SKIP_PROJS 不包括对查询有效的所有可用投影,则优化器会发出警告并忽略投影提示。

语法

FROM table-name /*+SKIP_PROJS( [[database.]schema.]projection[,...] )*/

参数

[database.]schema

数据库和架构。默认架构为 public。如果指定一个数据库,它必须是当前数据库。

projection
要跳过的投影。可以指定逗号分隔投影的列表。

示例

在此示例中,EXPLAIN 输出显示优化器使用了给定查询的投影 public.employee_dimension_b0


QUERY PLAN DESCRIPTION:
------------------------------

 EXPLAIN SELECT employee_last_name, employee_first_name, employee_city, job_title FROM employee_dimension;

 Access Path:
 +-STORAGE ACCESS for employee_dimension [Cost: 59, Rows: 10K (NO STATISTICS)] (PATH ID: 1)
 |  Projection: public.employee_dimension_b0
 |  Materialize: employee_dimension.employee_first_name, employee_dimension.employee_last_name, employee_dimension.employee_city, employee_dimension.job_title
 |  Execute on: All Nodes

您可使用 SKIP_PROJS 提示避免使用此投射。如果有对此查询有效的其他投影,优化器将改用此投影:


QUERY PLAN DESCRIPTION:
------------------------------

EXPLAIN SELECT employee_last_name, employee_first_name, employee_city, job_title FROM employee_dimension /*+SKIP_PROJS('public.employee_dimension')*/;

 Access Path:
 +-STORAGE ACCESS for employee_dimension [Cost: 156, Rows: 10K (NO STATISTICS)] (PATH ID: 1)
 |  Projection: public.employee_dimension_super
 |  Materialize: employee_dimension.employee_first_name, employee_dimension.employee_last_name, employee_dimension.emplo
yee_city, employee_dimension.job_title
 |  Execute on: Query Initiator