Use of raw for joining dates

kuopaz
Participant IV

Come across this (not for the first time) on trying to improve performance in my previous post.

I have situations where I have to join to a view in an explore on a date dimension. In SQL Server this is where the database column is of type Date (‘2021-04-23’ without hours, minutes, seconds, etc.). If I join on Looker type date the generated SQL will be, as expected:

CONVERT(VARCHAR(10), DateColumn ,120).

But if I join on type raw, the SQL will be just DateColumn (no conversion). This can make a massive difference in performance on joins.

0 0 473
0 REPLIES 0
Top Labels in this Space
Top Solution Authors