Is there a way to instruct dmbs_stats.gather_table_stats() to ignore a particular column?
Context: I have a table that has a virtual column that performs a standard_hash() of the concatenation of several columns. When this table is analyzed, that virtual column gets calculated for every row in the table. The presence of this virtual column, therefore, causes the time required to analyze the table to increase.
Most of the time I would like the virtual column to be analyzed, but sometimes I don't need the virtual column analyzed.
Generally, when the table is analyzed, I would want that virtual column to be analyzed. However, in our Data Warehouse batch load process we analyze the table several times during the load process for the benefit of subsequent downstream batch load processes. I do not always need the virtual column analyzed. Hence, I am inquiring if there is a way for me to control whether or not the virtual column is analyzed when its table is analyzed.
method_optparameter in your call todbms_stats.gather_table_statsto list the columns you want to include. Btw, in my opinion, these hash methods for comparing rows are not optimal, as they require either expensive CPU (if virtual or in code) or space (if materialized). Simply comparing each column individually between staging and target table is the best method for performance, IMO. Also, gathering stats multiple times on a table in a single load window sounds like overkill.