DWHPro helps thousands of visitors every month to become experts in Teradata and data warehouse design and operations by Roland Wenzlofsky

All issues

Optimizing Teradata SQL Queries by Avoiding Full Table Scans and Utilizing Secondary Indexes

Hi,


Boosting your SQL query performance can be as simple as rethinking the use of functions like COALESCE in the WHERE clause:


SELECT * FROM DWHPRO.INDEX_USAGE
WHERE COALESCE(TheStartDate,TheEndDate) = DATE'2022-10-10';


When used on indexed columns, it can hinder the effective use of indexes, leading to full table scans.


By avoiding such functions or replacing them with direct column references, we can allow the optimizer to leverage indexes more effectively, significantly speeding up query execution:


Read Now...


Best Regards,

Roland - DWHPro

Share
Get the next issue in your inbox
Free, and you can unsubscribe any time.

0 comments

More issues

All 74 →
#45 May 12, 2023

Outsmarting Teradata Limitations: A Workaround for Teradata Identity Columns in Volatile Tables

Read issue →
#44 May 11, 2023

Boost Database Performance: Master Teradata Space Management!

Read issue →