SQL/MP Query Guide
Analyzing Query Performance
HP NonStop SQL/MP Query Guide—524488-003
6-21
Query With Lower Bound
EXPLAIN
SELECT LAST_NAME, FIRST_NAME, SALARY
FROM EMPLOYEE
WHERE SALARY >= 50000 ;
The total cost of the query is 2.
The base table predicate is evaluated by the disk process:
Base table pred. : Will be evaluated by the disk process
SALARY >= 50000
Predicate and table selectivity are both approximately 72 percent, which indicates that
approximately 72 percent of the rows in the table satisfy the predicate. Specifically, for
a range predicate:
SECONDHIGHVALUE - 50000
selectivity = --------------------------------
SECONDHIGHVALUE - SECONDLOWVALUE
(Because there is only one predicate, predicate and table selectivity are the same.)
Example 6-10. EXPLAIN Plan for Lower-Bound Predicate
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Query plan 1
SQL request : Select
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
---------------------------------------------------------------------------
Plan step 1
---------------------------------------------------------------------------
Operation 1.0 : Scan
Table : \SQL1.$DATA8.PERSNL.EMPLOYEE
with correlation name EMPLOYEE
Access type : Record locks, stable access
Lock mode : Chosen by the system
Column processing : Requires retrieval of 3 out of 6 columns
Access path 1 : Primary
SBB for reads : Virtual
Begin key pred. : None
End key pred. : None
Index selectivity : Expect to examine 100% of rows from table
Index pred. : None
Base table pred. : Will be evaluated by the disk process
SALARY >= 50000
Pred. selectivity : Expect to select 72.3141% of rows from table
Executor pred. : None
Table selectivity : Expect to select 72.3141% of rows from table
Expected row count: 41 rows after the scan
Operation cost : 2
Total cost : 2