Stores the results of a scan in a worktable.
( store worktable_name ( [scan | i_scan | t_scan ] table_name ) )
is the name of the worktable to be created.
is the name of the base table to be scanned.
A worktable that is the result of the scan.
select c12, max(c11) from t1 group by c12
( plan ( store Worktab1 ( t_scan t1 ) ) ( t_scan ( work_t Worktab1 ) ) )
Specifies the two-step process of selecting the vector aggregate into a worktable, then selecting the results of the worktable.
The specified table is scanned, and the result is stored in a worktable
The legal places for a store operator in an abstract plan are:
Under a plan or union operator, where the store operator signifies a preprocessing step resulting in a worktable
Under a scan operator (but not under an i_scan or t_scan operator)
During plan capture mode, worktables are identified as Worktab1, Worktab2, and so on. For manually entered plans, any naming convention can be used.
The use of the reformatting strategy can be described in an abstract plan using the scan (store ( )) combination of operators. For example, if t2 has no indexes and is very large, the abstract plan below indicates that t2 should be scanned once, via a table scan, with the results stored in a worktable:
select * from t1, t2 where c11 > 0 and c12 = c21 and c22 between 0 and 10000
( nl_g_join (i_scan i_c11 t1) ( scan (store (t_scan t2 ))) )