--删除上一个执行计划
delete from plan_table where statement_id='testplan';
--执行计划
explain plan set statement_id='testplan' for
select count(1) from tb_site_month
--查看执行计划
select lpad('',5*(level-1))||operation operation,options,
object_name,cost,position
from plan_table
start with id=0 and statement_id='testplan'
connect by prior id=parent_id;
--查看执行计划2
select
STATEMENT_ID "语句ID",
PLAN_ID "计划ID",
TIMESTAMP "时间戳",
OPERATION "操作",
OPTIMIZER "优化器",
OBJECT_NAME "对象名称",
OBJECT_TYPE "对象的类型(表、索引等)",
SEARCH_COLUMNS "搜索栏",
PARTITION_START "分区启动",
PARTITION_STOP "分区停止",
PARTITION_ID "分区ID" ,
CPU_COST "CPU成本",
IO_COST "IO成本"
from plan_table
start with id=0 and statement_id='testplan'
connect by prior id=parent_id;