Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

4.18.1 Overview

Normally, you would have to execute two SQL statements to obtain the total number of hits and the values of the rows that were hit. However, by using the facility for returning the total number of hits, you can combine the SQL statement for obtaining the total number of hits and the SQL statement for obtaining the values of the hit rows into a single SQL statement. As a result, the retrieval time for executing the two SQL statements essentially becomes the same as the retrieval time for executing one SQL statement.

To use the facility for returning the total number of hits, specify the COUNT(*) OVER()window function in a selection expression. For details about window functions, see the manual HiRDB Version 8 SQL Reference.