Table level recollections of stats in Teradata 14.0 will remember the USING options at each statistics level and apply them at recollection time. To continue to use the same USING options, do not specify USING options at recollection time.
To address your question, only statistics that share the same USING options will be able to use the rollup aggregation and reusabel spool enhancements. And only statistics that are full collections (no sampling). This is true during the initial collections as well as recollections.
Example: Consider the following as your initial collection statements with different USING options:
COLLECT STATISTICS
USING SAMPLE 20 PERCENT
COLUMN (p_avail_date)
ON Product;
COLLECT STATISTICS
USING MAXINTERVALS 100
AND MAXVALUELENGTH 30
COLUMN ( P_BRAND ) ,
COLUMN ( P_CONTAINER ) ,
COLUMN ( P_SIZE ) ,
COLUMN ( P_BRAND ,P_CONTAINER ,P_SIZE )
ON Product;
COLLECT STATISTICS
USING MAXINTERVALS 400
COLUMN (p_name)
ON Product;
For table level statement recollects all the three statistics collections on the Product table applying each of the USING options as it recollects.
COLLECT STATISTICS ON Product;
However, only the second statement of the three will be considered for the rollup optimization where spool can be re-used. Since the 3 statements have different USING specifications they cannot be spooled together.
Thanks, -Carrie
Table level recollections of stats in Teradata 14.0 will remember the USING options at each statistics level and apply them at recollection time. To continue to use the same USING options, do not specify USING options at recollection time.
To address your question, only statistics that share the same USING options will be able to use the rollup aggregation and reusabel spool enhancements. And only statistics that are full collections (no sampling). This is true during the initial collections as well as recollections.
Example: Consider the following as your initial collection statements with different USING options:
COLLECT STATISTICS
USING SAMPLE 20 PERCENT
COLUMN (p_avail_date)
ON Product;
COLLECT STATISTICS
USING MAXINTERVALS 100
AND MAXVALUELENGTH 30
COLUMN ( P_BRAND ) ,
COLUMN ( P_CONTAINER ) ,
COLUMN ( P_SIZE ) ,
COLUMN ( P_BRAND ,P_CONTAINER ,P_SIZE )
ON Product;
COLLECT STATISTICS
USING MAXINTERVALS 400
COLUMN (p_name)
ON Product;
For table level statement recollects all the three statistics collections on the Product table applying each of the USING options as it recollects.
COLLECT STATISTICS ON Product;
However, only the second statement of the three will be considered for the rollup optimization where spool can be re-used. Since the 3 statements have different USING specifications they cannot be spooled together.
Thanks, -Carrie