Previous Topic: -255 - COLUMN xxx NOT NULL WITHOUT DEFAULTNext Topic: -257 - FOREIGN KEY COLUMN xxx NOT FOUND


-256 - RQA TOO LARGE FOR TABLE ttt

Explanation

The Compound Boolean Selection Request Qualification Area (RQA) generated by the SQL statement for table ttt is larger than the maximum RQA size of 9999 bytes.

The SQLSTATE that equates to this SQL return code is 54S03.

User Response

Simplify the WHERE predicates for the indicated table and rebind.

The Request Qualification Area (RQA) is probably too large because the WHERE clause is converted into disjunctive normal form. For example, given that p1 through p5 are predicates, consider the following WHERE clause:

WHERE (p1 or p2)
  and (p3 or p4 or p5)

The above must be converted in the RQA to:

   (p1 & p3)
or (p1 & p4)
or (p1 & p5)
or (p2 & p3)
or (p2 & p4)
or (p2 & p5)

The predicates p3 through p5 are repeated for each term of the first and operand. If and (p6 or p7) is added, they repeat six times (the number of terms ANDed with it). Each predicate in the RQA takes 25 bytes plus the length of the literal (or host variable), or 13 bytes if a column is compared to another column (a non-column compared to a non-column is not placed in the RQA).

Because it can be difficult to compute the number of predicates in disjunctive normal form, we recommend using alternative predicates that are not placed in the RQA. In the following, for example, the IN list and predicates with expressions are not placed in the RQA.

 COLn <op> <value1> OR COLn <op> <value2> --> COLn IN(<value1>,<value2>

 ColNumber <op> <value>                   --> ColNumber <op> <value> * 1

 ColString <op> <value>                   -->     ?     <op> <value> * 1

The string concatenation expression must have a total length greater than the column in the first operand, because concatenated literals are converted to a single value. When the total length is longer than the column, however, the predicate is not placed in the RQA. The extra character(s) must be blanks. The shorter column is extended with blanks and compares correctly. When a predicate is not placed in the RQA, it is evaluated by SQL instead of the Compound Boolean Selection. If the column being restricted is not used to restrict the index scan range, there is no significant performance impact. Therefore:

  1. Convert predicates with non-indexed columns.
  2. Convert columns that are not the first column of a key.
  3. Convert remaining predicates only if necessary.