RESULT_STRUCTURE
The SET RESULT_STRUCTURE statement changes the default storage structure for tables created with the CREATE TABLE...AS SELECT and DECLARE GLOBAL TEMPORARY TABLE...AS SELECT statements.
This storage structure can be any of the valid storage structures available using the WITH STRUCTURE= option (specifically, HEAP, CHEAP, HEAPSORT, CHEAPSORT, HASH, CHASH, BTREE, CBTREE, ISAM, CISAM, X100 or X100_ROW).
If no SET RESULT_STRUCTURE statement, or equivalent, is in force, then the default storage structure specified by the default_structure DBMS configuration item is used. If there is no default_structure DBMS configuration rule, the default is CHEAP.
The default storage structure for a table created by the CREATE TABLE AS statement is CHEAP. For example:
set result_structure hash;
create temp as select id ... ;
does the same as:
create temp as select id ... ;
modify temp to hash;
For BTREE, CBTREE, HASH, CHASH, ISAM, and CISAM, the newly created table is automatically indexed on the first column. This results in the above table “temp” being created with a storage structure of hash, keyed on the first column “id”.
Last modified date: 08/14/2024