Sun StorageTek 5800 System Client API Reference Guide

Query Size Limit

There is a hard limit when querying a live 5800 system or hive on the combined size of query parameters and literal values that can be processed in one query. The limit is slightly over 8000 bytes. The query string itself does not count against this limit, just the parameter and literal values in the query.

Each additional parameter or literal in the query contributes 2 bytes of overhead plus the number of bytes to represent the query value. For this calculation, each date or time value consumes 4 bytes. Each long, double, or timestamp value consumes 8 bytes. A binary or char field consumes the same number of bytes as the length of the value. A string value consumes twice as many bytes as the length of the value. These sizes are similar to what is described in the Sun StorageTek 5800 System Administration Guide, Table 7-6, Number of Bytes Used by Each Element Type in a Schema Table.

For example, assume dynamic parameter 1 is bound to string "Hello" in the query system.test.type_string=?. The parameter length would then be 12 bytes: 2 bytes overhead plus 10 bytes for a 5-character string parameter.

Conversely, note that in the query system.test.type_string like '%Hello%' that the parameter is 16 bytes: 2 bytes overhead plus 14 bytes for a 7 character string regardless of the declared size of the system.test.type_string field in the schema.

For the query system.test.type_date = {date '2007-01-1'} AND system.test.type_char='Hello', the parameter length is 13 bytes: 2 bytes overhead for each of two query values plus 4 bytes for a date literal plus 5 bytes for a 5-character char parameter.