Examples | Heatmap Table Function and Macro | Teradata Vantage - 17.10 - Example: Using the tdheatmap Function - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Administration
Programming Reference
Publication ID
B035-1210-171K
Language
English (United States)

You can use the tdheatmap function to return just a few important columns, like the table name, cylinder ID, and temperature.

SELECT date TheDate,
       t1.ampnumber,
       dbase.databasenamei DatabaseName, 
       tvm.tvmnamei TableName, 
       to_byte(t1.cylinderidmsw) || to_byte(t1.cylinderidlsw) CylinderId,
       t1.temperature
FROM TABLE(tdheatmap(2)) AS t1,
     dbc.tvm tvm,
     dbc.dbase dbase
WHERE t1.starttableiduniq = tvm.tvmid
AND   tvm.databaseid = dbase.databaseid;
TheDate AmpNumber DatabaseName TableName CylinderId Temperature
11/10/2016 2 TD_SYSFNLIB BITNOT 00-06-00-02-00-00-00-05 10.58
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-46 10
11/10/2016 2 TD_SYSFNLIB WEEKNUMBER_ OF_ CALENDAR_TSWZ 00-06-00-02-00-00-00-45 17.83
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-49 10
11/10/2016 2 DBC CHANGEDROWJOURNAL 00-06-00-02-00-00-00-21 10.06
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-4A 10
11/10/2016 2 DBC ALL 00-06-00-02-00-00-00-23 10
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-47 10
11/10/2016 2 DBC TVFIELDS 00-06-00-02-00-00-00-3A 10.21
11/10/2016 2 DW123 MILLIONS 00-06-00-02-00-00-00-4B 10
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-48 10
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-4E 10