SQL/MP Query Guide
Analyzing Query Performance
HP NonStop SQL/MP Query Guide—524488-003
6-75
EXPLAIN Plan for INSERT-SELECT
EXPLAIN Plan for INSERT-SELECT
This example shows the EXPLAIN plan for an INSERT-SELECT operation.
The query selects data from the ordone table and inserts it into the ordtwo table, as
follows:
EXPLAIN
INSERT INTO ordone SELECT * FROM ordtwo ;
The total cost of the query is 2.
Example 6-45. EXPLAIN Plan for INSERT Statement
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Query plan 1
SQL request : Insert
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
---------------------------------------------------------------------------
Plan step 1
---------------------------------------------------------------------------
Operation 1.0 : Insert
Table : \SQL1.$DATA7.REG1.ORD2
Access path : Primary
SBB for Insert : Requested by the optimizer
Insert Cost : 1
Operation cost : 1
Total cost : 1