Chapter 11. maxDBrows attribute

This is attribute of <table_name>Query.java class. It is used in execution of select statements. It defines maximal number of rows that can be retrieved when query is executed.

If query is executed on the database, this is maximal number of rows retrieved from database. If query is retrieved from the query cache, this is the number of oids from result list (starting from the beginning of the list) that will be retrieved.

This attribute is private. The public methods that work with this attribute are also in the <table_name>Query.java class and they are:

Sets attribute maxDBrows to value maxRows.

Returns current value of the attribute maxDBrows.

The default value of this attribute is 0.

If unique attribute or security is used, we recommend using (instead of this attribute) databaseLimit attribute, and its methods:

because databaseLimit attribute respects unique attribute and security. If unique attribute and security are not used, the query automatically sets maxDBrows parameter:

if ((user == null) && (databaseLimit != 0) && (! unique))
  setMaxRows(databaseLimit + 1);

For example, databaseLimit is set to 20. If unique attribute is set to true, the query will return 20 unique results (if there are so many results). If security is used, the query will return 20 results which the user can read (if there are so many results).

If instead of databaseLimit attribute is used maxDBrows attribute when unique parameter or security is used, we do not know for sure how many results we will get as query results.

For example, maxDBrows is set to 20. If unique attribute is set to true, the query will return from the database (or cache) 20 results, and then filter them (remove ununique results). So, the query results will return 20 or less results (if there were ununique results in those 20 results). The story is the same for the security: The query will return from the database (or cache) 20 results, and then filter them (remove results which the user can not read). So, the query results will return 20 or less results (if there were results in those 20 results to which user did not have acess rights).