Question

Use of raw for joining dates

  • 23 April 2021
  • 0 replies
  • 12 views

Userlevel 1

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 replies

Be the first to reply!

Reply