SQL/MX 3.2.1 Query Guide (H06.26+, J06.15+)
Reviewing Query Execution Plans
HP NonStop SQL/MX Release 3.2.1 Query Guide—663851-003
4-22
Simple Query Example
Simple Query Example
This query selects all rows and columns from the EMPLOYEE table:
>>prepare q1 from
+>select * from employee;
--- SQL command prepared.
>>execute Q1;
The query returns this result:
EMPNUM FIRST_NAME LAST_NAME DEPTNUM JOBCODE SALARY
------ ----------- ---------- ------- -------- ------
1 ROGER GREEN 9000 100 175500.00
. . . . .
568 JESSICA CRINER 3500 300 39500.00
--- 62 row(s) selected.
To obtain statistics about the query, after the query executes, enter:
>>DISPLAY STATISTICS;
The statistics are returned:
Start Time 2005/11/04 10:45:53.916
End Time 2005/11/04 10:45:53.975
Elapsed Time 00:00:00.059
Compile Time 00:00:00.000
Execution Time 00:00:00.059
Table Name Records Records Disk Message Message Lock
Accessed Used I/Os Count Bytes
SAMDBCAT.PERSNL.EMPLOYEE
62 62 2 2 14608 0
If you want to display statistics automatically, enter SET STATISTICS ON at any point
during the session. As a result, the statistics appear immediately after each command
executes.
Using Measure
Use the Measure product to gather statistics on an SQL/MX database and application
programs. The Measure product provides statistics on process execution (SQLPROC)
and on individual statement execution (SQLSTMT). For information on using Measure
with NonStop SQL/MX, see the SQL/MX Release 3.2 Installation and upgrade Guide
and SQL/MX Release 3.2 Management Manual. For information about the Measure
product, see the Measure Reference Manual.
TP663851.fm Page 22 Wednesday, January 30, 2013 5:37 PM










