Threshold parameter

The threshold parameter in the query function restricts the number of objects returned from the server to the client in the query result set.

Because query result sets in production scenarios can contain thousands or even millions of items, it is a best practice to always specify a threshold. The threshold parameter can be useful, for example, in a graphical user interface where only a small number of items should be displayed at one time. If you set the threshold parameter accordingly, the database query is faster and less data needs to transfer from the server to the client.

If you specify both an order-by clause and a threshold parameter in your query, the tuples that are returned depend on your database system. For example, some database systems apply the sort criteria to all of the records and then return the requested number of tuples. Other database systems first take the requested number of tuples and then apply the sort criteria.

If this parameter is set to null and the skip-tuples parameter is not set, all of the qualifying objects are returned.

Example of a threshold parameter


Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)