PROFILE

分析单个 SQL 语句。

语法

PROFILE { sql-statement }

参数

sql‑statement
查询 (SELECT) 语句或 DML 语句,例如,您可以分析 INSERTUPDATECOPYMERGE

输出

将分析摘要写入 stderr,将详细信息保存至系统编录 V_MONITOR.EXECUTION_ENGINE_PROFILES

特权

需要相同的权限运行已分析的语句

描述

PROFILE 生成关于目标语句执行的详细信息,并将其保存在系统编录 V_MONITOR.EXECUTION_ENGINE_PROFILES 中。查询输出通过分析总结执行:分析标识符 transaction_idstatement_id、启动程序的查询内存以及需要的总内存。例如:

=> PROFILE SELECT customer_name, annual_income FROM public.customer_dimension WHERE (customer_gender, annual_income) IN (SELECT customer_gender, MAX(annual_income) FROM public.customer_dimension GROUP BY customer_gender);
NOTICE 4788:  Statement is being profiled
HINT:  Select * from v_monitor.execution_engine_profiles where transaction_id=45035996274683334 and statement_id=7;
NOTICE 3557:  Initiator memory for query: [on pool general: 708421 KB, minimum: 554324 KB]
NOTICE 5077:  Total memory required by query: [708421 KB]
  customer_name   | annual_income
------------------+---------------
 Emily G. Vogel   |        999998
 James M. McNulty |        999979
(2 rows)

使用分析标识符在给定的查询中查询分析信息的表。

另请参阅

分析单个语句