H2 Database - Explain

H2 Database - Explain

The EXPLAIN command displays the execution plan for the statement. When we execute the statement with the EXPLAIN ANALYZE command, the query plan will include the actual number of row checks for each table.

Syntax

Following is the general syntax of the EXPLAIN command.

EXPLAIN { [ PLAN FOR ] | ANALYZE } { select | insert | update | delete | merge} 

Along with this syntax, we can use select, insert, delete and merge.

example

This example explains the details of the request plan for client ID 1.

EXPLAIN SELECT * FROM CUSTOMER WHERE ID = 1;

The above command produces the following output −