Start a new topic

Execute as explain plan - Result set is empty (DB2)

[This topic is migrated from our old forums. The original author name has been removed]

Hi, I need to analyse the execution plan for several statements, and I was able to do this with DBVisualizer version 8.something, but with the latest version 9.0.2 the EXPLAIN tab only shows the grey "Result set is empty" box. The connected database is a DB2 9.7. I already played around a bit with the configurations under Properties -> Explain plan, created and dropped the explain plan tables, but nothing helped so far. Is there some configuration necessary that I missed? Thanks

[This reply is migrated from our old forums.]

Re: Execute as explain plan - Result set is empty (DB2)
Timm, If you go into the Explain Settings and check "Create Explain Tables if not Exists" and uncheck "Drop Explain Tables". Then after running the explain, are there any EXPLAIN_xxx tables in the selected schema? Also, try run the explain with debug mode of DbVisualizer enabled (in Tools->Debug Window just check the "Debug DbVisualizer" setting). Post or email the debug output. Regards Roger support@dbvis.com
[This reply is migrated from our old forums. The original author name has been removed]

Re: Execute as explain plan - Result set is empty (DB2)
Hi Roger, the tables EXPLAIN_ARGUMENT EXPLAIN_INSTANCE EXPLAIN_OBJECT EXPLAIN_OPERATOR EXPLAIN_PREDICATE EXPLAIN_STATEMENT EXPLAIN_STREAM were created by the checked "create explain tables if not exists". The debug output is the following: 12:02:11 [DEBUG pool-3-thread-18 E.?] DefaultEditor24: f.getTables(null, "RSVP", "EXPLAIN_INSTANCE", null) 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 J.execute] Executing... 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 J.setCurrentCatalog] DbConnection='dr local' Catalog='null' Schema='null' NewCatalog='null' 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 AbstractFacade.getColumn] executing "select current schema from sysibm.sysdummy1" 12:02:11 [DEBUG pool-3-thread-18 C.?] DefaultEditor24: b.createStatement() 12:02:11 [DEBUG pool-3-thread-18 B.?] DefaultEditor24: no.executeQuery("select current schema from sysibm.sysdummy1") 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 J.setCurrentSchema] DbConnection='dr local' Catalog='null' Schema='RSVP' NewSchema='RSVP' 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 AbstractFacade.getColumn] executing "select current schema from sysibm.sysdummy1" 12:02:11 [DEBUG pool-3-thread-18 C.?] DefaultEditor24: b.createStatement() 12:02:11 [DEBUG pool-3-thread-18 B.?] DefaultEditor24: no.executeQuery("select current schema from sysibm.sysdummy1") 12:02:11 [DEBUG pool-3-thread-18 C.?] DefaultEditor24: b.createStatement() 12:02:11 [DEBUG pool-3-thread-18 B.?] DefaultEditor24: no.execute("explain plan set querytag = 'dbvis-1358852531930' for select * from RSVP.SCHADENSFAELLE where SCHADENSFAELLE.SNF_AKTEN_ZEICHEN like 'Test%'") 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 J.execute] Executing... 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 J.setCurrentCatalog] DbConnection='dr local' Catalog='null' Schema='null' NewCatalog='null' 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 AbstractFacade.getColumn] executing "select current schema from sysibm.sysdummy1" 12:02:11 [DEBUG pool-3-thread-18 C.?] DefaultEditor24: b.createStatement() 12:02:11 [DEBUG pool-3-thread-18 B.?] DefaultEditor24: no.executeQuery("select current schema from sysibm.sysdummy1") 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 J.setCurrentSchema] DbConnection='dr local' Catalog='null' Schema='RSVP' NewSchema='RSVP' 12:02:11 [DEBUG ExecutorRunner-pool-2-thread-18 AbstractFacade.getColumn] executing "select current schema from sysibm.sysdummy1" 12:02:11 [DEBUG pool-3-thread-18 C.?] DefaultEditor24: b.createStatement() 12:02:11 [DEBUG pool-3-thread-18 B.?] DefaultEditor24: no.executeQuery("select current schema from sysibm.sysdummy1") 12:02:11 [DEBUG pool-3-thread-18 C.?] DefaultEditor24: b.createStatement() 12:02:11 [DEBUG pool-3-thread-18 B.?] DefaultEditor24: no.execute("SELECT OPERATOR_TYPE, STR.SOURCE_ID, STR.TARGET_ID, OBJ.OBJECT_SCHEMA, OBJ.OBJECT_NAME, OPER.TOTAL_COST, QUERYTAG, CPU_COST, IO_COST, FIRST_ROW_COST, RE_TOTAL_COST, RE_CPU_COST, RE_IO_COST, COMM_COST, FIRST_COMM_COST, BUFFERS, REMOTE_TOTAL_COST, REMOTE_COMM_COST, STR.STREAM_COUNT, STR.COLUMN_COUNT FROM (((RSVP.EXPLAIN_OPERATOR OPER JOIN RSVP.EXPLAIN_STATEMENT STMT ON STMT.QUERYTAG = 'dbvis-1358852531930' AND OPER.EXPLAIN_REQUESTER = STMT.EXPLAIN_REQUESTER AND OPER.EXPLAIN_TIME = STMT.EXPLAIN_TIME AND OPER.SOURCE_NAME = STMT.SOURCE_NAME AND OPER.SOURCE_SCHEMA = STMT.SOURCE_SCHEMA AND OPER.EXPLAIN_LEVEL = STMT.EXPLAIN_LEVEL AND OPER.STMTNO = STMT.STMTNO AND OPER.SECTNO = STMT.SECTNO AND STMT.EXPLAIN_LEVEL = 'P') LEFT JOIN RSVP.EXPLAIN_STREAM STR ON OPER.OPERATOR_ID = STR.SOURCE_ID AND OPER.EXPLAIN_REQUESTER = STR.EXPLAIN_REQUESTER AND OPER.EXPLAIN_TIME = STR.EXPLAIN_TIME AND OPER.SOURCE_NAME = STR.SOURCE_NAME AND OPER.SOURCE_SCHEMA = STR.SOURCE_SCHEMA AND OPER.EXPLAIN_LEVEL = STR.EXPLAIN_LEVEL AND OPER.STMTNO = STR.STMTNO AND OPER.SECTNO = STR.SECTNO ) LEFT JOIN RSVP.EXPLAIN_STREAM OBJ ON STR.SOURCE_ID = OBJ.TARGET_ID AND OBJ.SOURCE_ID = -1 AND STR.EXPLAIN_REQUESTER = OBJ.EXPLAIN_REQUESTER AND STR.EXPLAIN_TIME = OBJ.EXPLAIN_TIME AND STR.SOURCE_NAME = OBJ.SOURCE_NAME AND STR.SOURCE_SCHEMA = OBJ.SOURCE_SCHEMA AND STR.EXPLAIN_LEVEL = OBJ.EXPLAIN_LEVEL AND STR.STMTNO = OBJ.STMTNO AND STR.SECTNO = OBJ.SECTNO ) ") The result shows "Result set is empty". Greetings
[This reply is migrated from our old forums.]

Re: Execute as explain plan - Result set is empty (DB2)
Timm, What schema is set in the explain properties? Have you tried with "Use Default Schema" (SYSTOOLS)? What is your login schema? Have you set the currentSchema connection property? The explain support in DB2 is quite restricted as it store explain data in the explain tables located either in the login schema or in SYSTOOLS. Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: Execute as explain plan - Result set is empty (DB2)
I tried to execute explain plan with the "Default Plan Table" and with the "User Defined Plan Table" RSVP. My login schema is DB2ADMIN. The Schema I use is RSVP, this is also set in the SQL editor. I changed the Database in the Connection Properties under "Server Info" from default to RSVP but that made no difference so far. Greetings
[This reply is migrated from our old forums.]

Re: Execute as explain plan - Result set is empty (DB2)
Timm, Thanks. What happen if you set the Schema Name in Explain Plan Tables to "DB2ADMIN" and check "Use User Defined Schema"? Regards Roger