SKIP_STATISTICS
指示优化器生成仅包含由
ANALYZE_ROW_COUNT
收集的最少统计信息的查询计划。优化器会忽略由
ANALYZE_STATISTICS
和
ANALYZE_STATISTICS_PARTITION
使用和生成的其他统计信息。当用于对小型表执行查询时,此提示尤其有用,其中收集完整统计信息所需的时间量通常大于实际执行时间。
语法
SELECT /*+SKIP_STAT[ISTIC]S*/
EXPLAIN 输出
EXPLAIN
为包含 SKIP_STATISTICS
(使用其缩写形式 SKIP_STATS
)的查询返回以下输出:
=> EXPLAIN SELECT /*+ SKIP_STATS*/ customer_key, customer_name, customer_gender, customer_city||', '||customer_state, customer_age
FROM customer_dimension WHERE customer_region = 'East' AND customer_age > 60;
QUERY PLAN DESCRIPTION:
------------------------------
EXPLAIN SELECT /*+ SKIP_STATS*/ customer_key, customer_name, customer_gender, customer_city||', '||customer_state,
customer_age FROM customer_dimension WHERE customer_region = 'East' AND customer_age > 60;
Access Path:
+-STORAGE ACCESS for customer_dimension [Cost: 2K, Rows: 10K (STATISTICS SKIPPED)] (PATH ID: 1)
| Projection: public.customer_dimension_b0
| Materialize: public.customer_dimension.customer_age, public.customer_dimension.customer_key, public.customer_dimensi
on.customer_name, public.customer_dimension.customer_gender, public.customer_dimension.customer_city, public.customer_di
mension.customer_state
| Filter: (public.customer_dimension.customer_region = 'East')
| Filter: (public.customer_dimension.customer_age > 60)
| Execute on: All Nodes
...