Neoview Repository User Guide (R2.4)
ORDER BY datasource
FOR READ UNCOMMITTED ACCESS;
NUM_OF_QUERIESDATASOURCE
51NEO0101_JOM
44TDM_Default_DataSource
162neodb
Queries within the Past 24 Hours, Grouped by Client ID and Including Average and
Maximum Elapsed Time
SELECT client_id,
COUNT(*) AS num_of_queries,
AVG(query_elapsed_time)/1000 AS avg_qry_elapsed_msec,
MAX(query_elapsed_time)/1000 AS max_qry_elapsed_msec
FROM NEO.HP_METRICS.ODBC_QUERY_STATS_V2
WHERE QUERY_START_DATETIME <= CURRENT
AND QUERY_START_DATETIME >= CURRENT - INTERVAL '1' DAY
AND STATEMENT_STATE = 'COMPLETE'
GROUP BY client_id
ORDER BY client_id
FOR READ UNCOMMITTED ACCESS;
MAX_QRY_ELAPSED_TIMEAVG_QRY_ELAPSED_MSECNUM_OF_QUERIESCLIENT_ID
327501733016EXPTC082205
7288702034051ORDROBERTSC-P2
2070260162ORDHROTHGAR-P2
564647031673028ordbantam-p2
Formatting Techniques to Enhance Readability of Query Output
Often the typical data in a column is much narrower than the maximum defined column size.
For example, the SESSION_ID column is defined as CHARACTER(108), and the DATASOURCE
column is defined as CHARACTER(128); actual values in those columns are usually much shorter.
Many query tools support automatic adjustment of column size for viewing results, but in some
cases, it is necessary to adjust the size of the columns returned from the query to improve
readability of the results.
Neoview SQL supports several string manipulation functions. Among these, the LEFT function
is useful for simple column size reduction. In addition to string functions, use of CAST is
sometimes helpful for modifying the appearance or size of numeric fields.
For example, the following query produces results that can be difficult to read:
select [first 10]
datasource,
client_id,
count(*) as query_count
from NEO.HP_METRICS.ODBC_QUERY_STATS_V1
where statement_status = 'START'
group by datasource, client_id
order by datasource, client_id;
DATASOURCE
CLIENT_ID QUERY_COUNT
--------------------------------------------------------------------------------------------------------------------------------
--------------- --------------------
RIBE_FIN
NWESTABX-DC76C 1
RR
FENSTERM-DC76C 6593
Formatting Techniques to Enhance Readability of Query Output 71