How to do it...

  1. Identify the query on which multi-column stats need to be collected.
  2. Identify the columns that are joined using AND conditions. Columns that frequently appear together as selection criteria or join criteria, and for which values are expressed with an equality operator, will benefit from multi-column statistics:
/*Multicolumn statistics*/Collect stat column (main_addnl_type,cre_ts) --- Multicolumn stats on cookbook_scratch.dw_PI_source 

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.