When collecting stats in the following format, it was my understanding that the table is read once; similar to what I have been told about just collecting at the table level.
COLLECT STATS
COLUMN(COL_A),
COLUMN(COL_B),
COLUMN(COL_C),
COLUMN(PARTITION)
ON <databasename>.<tablename>;
However, when reading the explain, it appears that it doing steps similar to the following for each individual column:
We do a SUM step to aggregate from <database>.table by way of an all-rows scan.
Aggregate Intermediate Results are computed globally, then placed in Spool 35472.
We Then we save the UPDATED STATISTICS from Spool 35472(Last Use) into Spool 35474, which is built locally on a single AMP derived
from the hash of the table id
Questions:
1. Is my understanding incorrect?
2. Will Teradata only do one pass when collecting at the table level only?
Thanks,
Mark
Carrie,
When collecting stats in the following format, it was my understanding that the table is read once; similar to what I have been told about just collecting at the table level.
COLLECT STATS
COLUMN(COL_A),
COLUMN(COL_B),
COLUMN(COL_C),
COLUMN(PARTITION)
ON <databasename>.<tablename>;
However, when reading the explain, it appears that it doing steps similar to the following for each individual column:
We do a SUM step to aggregate from <database>.table by way of an all-rows scan.
Aggregate Intermediate Results are computed globally, then placed in Spool 35472.
We Then we save the UPDATED STATISTICS from Spool 35472(Last Use) into Spool 35474, which is built locally on a single AMP derived
from the hash of the table id
Questions:
1. Is my understanding incorrect?
2. Will Teradata only do one pass when collecting at the table level only?
Thanks,
Mark