DB2: explain plan

 $ db2 set current explain mode explain

DB20000I  The SQL command completed successfully.




[tst4ins4@db2tst602  ~]

$ mv expquery.txt expquery.sql

[tst4ins4@db2tst602  ~]

$ db2 -tvf expquery.sql

select users_id FROM wcs.users WHERE setccurr = 'CAD' AND registertype = 'G' AND users_id > 0 AND users_id < 905000000

SQL0217W  The statement was not executed as only Explain information requests

are being processed.  SQLSTATE=01604



[tst4ins4@db2tst602  ~]

$  db2 set current explain mode no

DB20000I  The SQL command completed successfully.



[tst4ins4@db2tst602  ~]

$ db2exfmt -d wctst10 -1 -o expquery.EXFMT

DB2 Universal Database Version 11.5, 5622-044 (c) Copyright IBM Corp. 1991, 2019

Licensed Material - Program Property of IBM

IBM DATABASE 2 Explain Table Format Tool

Connecting to the Database.

Connect to Database Successful.

Using SYSTOOLS schema for Explain tables.

Output is in expquery.EXFMT.

Executing Connect Reset -- Connect Reset was Successful.



[tst4ins4@db2tst602  ~]

$ less -S expquery.EXFMT

[tst4ins4@db2tst602  ~]

$ ls -lrt exp*

-rw-r--r-- 1 tst4ins4 db2iadm1  120 Sep 26 15:50 expquery.sql

-rw-r--r-- 1 tst4ins4 db2iadm1 6472 Sep 26 16:04 expquery.EXFMT

[tst4ins4@db2tst602  ~]

$ view expquery.EXFMT



Comments

Popular posts from this blog

Oracle: To clean up WRI$_ADV_OBJECTS