Describes a stored worktable.
( work_t [ worktable_name | (correlation_name worktable_name) ] )
is the name of a worktable.
is the correlation name specified for a worktable, if any.
A stored table.
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 vector aggregates into a worktable, then selecting the results of the worktable.
Matches the stored table against a work table in the query plan.
The store operator creates a worktable; the work_t operator identifies a stored worktable for later access in the abstract plan.
During plan capture mode, worktables are identified as Worktab1, Worktab2, and so on. For manually entered plans, any naming convention can be used.
If the scan of the worktable is never specified explicitly with a scan operator, the worktable does not have to be named and the work_t operator can be omitted. The following plan uses an empty scan operator “( )” in place of the t_scan and work_t specifications used in example
( plan ( store ( t_scan titles ) ) () )
Correlation names for worktables are needed only for self-joined materialized views, for example:
create view v as select distinct c11 from t1 select * from v v1, v v2 where ...
( plan ( store Worktab1 ( t_scan ( table t1 (in ( view v ) ) ) ) ) ( g_join ( t_scan (work_t ( v1 Worktab1 ) ) ) ( t_scan (work_t ( v2 Worktab1 ) ) ) ) )