SHOW PLANFILE
Use the SHOW PLANFILE command to display the contents of a query plan file. This is helpful for troubleshooting or investigating query behaviors.
Syntax
Syntax for showing a plan
file:
SHOW PLANFILE [<planId>]
Input
The SHOW PLANFILE command
has the following inputs:
Input | Description |
---|---|
<planId> |
The plan ID for the plan to be displayed. The command searches the two newest compressed tar archives for the requested plan. The default is the plan that most recently ran in the current database session. |
Privileges
You must be the admin user or you must be granted the Select privilege for the _vt_plan_file table.
Usage
Sample usage with a short
excerpt of the output.
TESTER(USER1)=> SHOW PLANFILE;
<<<<<<<<<<< NPS VERSION >>>>>>>>>>
-- DBOS Version: 7.0.0-0.D-1.P-0.Bld-24857
-- NPS Version : Release 7.0, Dev 1 [Build 24857]
<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>
(dbosEvent) Full Plan
Execution Plan [plan id 14, job id 14, sig 0xd1ba4d02]:
SQL: select * from ne_region where r_regionkey=2
1[00]: spu ScanNode table "TESTER.USER1.NE_REGION" 211553 memoryMode=no
flags=0x0 index=0 cost=1 (o)
-- Cost=0.0..0.0 Rows=1 Width=142 Size=142 Conf=80 {(R_REGIONKEY)}
1[01]: spu RestrictNode (non-NULL)
-- (R_REGIONKEY = 2)
1[02]: spu ProjectNode, 3 cols, projectFlags=0x0
0:R_REGIONKEY 1:R_NAME 2:R_COMMENT
-- 0:R_REGIONKEY 1:R_NAME 2:R_COMMENT
1[03]: spu ReturnNode
501[00]: dbs ReturnNode
End Execution Plan
⋮
----------------
Time Duration
Plan Submit 2012-09-06 15:36:40.458393 EDT 0.002 (plan waiting)
Plan Start 2012-09-06 15:36:40.460503 EDT 0.004 (plan execution)
Plan Finish 2012-09-06 15:36:40.464997 EDT 0.007 (plan total)
----------------
⋮