8. SQL Statements : SET : Result_Structure
 
Share this page                  
Result_Structure
The SET RESULT_STRUCTURE statement changes the default storage structure for tables created with the CREATE TABLE...AS SELECT statement.
This storage structure can be any of the structures described in the MODIFY statement, that is, HEAP, CHEAP, HEAPSORT, CHEAPSORT, HASH, CHASH, BTREE, CBTREE, ISAM, OR CISAM.
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”.