select into statements

select into creates a new table to store the query’s result set. Adaptive Server optimizes the base query portion of a select into command in the same way it does a standard query, considering both parallel and serial access methods. A select into statement that is executed in parallel:

  1. Creates the new table using columns specified in the select into statement.

  2. Creates n partitions in the new table, where n is the degree of parallelism that the optimizer chose for the query as a whole.

  3. Populates the new table with query results, using n worker processes.

  4. Unpartitions the new table.

Performing a select into statement in parallel requires additional steps than the equivalent serial query plan. Therefore, the execution of a parallel select into statement takes place using four discrete transactions, rather than the two transactions of a serial select into statement. See select in the Adaptive Server Reference Manual for information about how this affects the database recovery process.