|
Archives of the TeradataForumMessage Posted: Sat, 13 Dec 2003 @ 11:02:58 GMT
Here's what happens: - The definition (ie- name, data type, format) of any given column is contained in the dictionary table DBC.TVFIELDS. - The statistics for a column are kept in the DBC.TVFIELDS, column FIELDSTATISTICS. If statistics haven't been collected for that column, then FIELDSTATISTICS will contain a null. - When an index is created (whether CREATE TABLE or CREATE INDEX), then one row is inserted into DBC.INDEXES for each column that makes-up the index. - The statistics for a multi-column index are kept in DBC.INDEXES, column INDEXSTATISTICS. At CREATE time, the column INDEXSTATISTICS will be populated with a null. - The statistics for a single-column index are kept in DBC.TVFIELDS, column FIELDSTATISTICS. The presence of a row for that column in DBC.INDEXES signals that it is an index. The fact that an index consists of a single column signals that the actual statistics are to be found DBC.TVFIELDS. If you've collected statistics on a single-column index and then dropped the index, the statistics for that column still exists in DBC.TVFIELDS. Dropping a single-column index does not change the fact that statistics have been collected on the column. In that same vein, collecting statistics on a column which happens to be an index is the same as collecting statistics on that index. Dropping statistics on a column which happens to be an index is the same as dropping statistics on that index. Bottom line for a single-column index: COLLECT/DROP STATISTICS ON COLUMN is effectively the same as COLLECT/DROP STATISTICS ON INDEX. To all outward purposes, they are the same thing - the only real difference is internal and largely invisible.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||