2

I'm trying to replace certain CASE WHEN in SQL by multiple {% if %} parameters where applicable in LookML in order to improve query speed.

How can I be sure that this will improve or slow down the over all performance of an explore or dashboard ?

  • This depends entirely on the performance characteristics of the RDBMS your Looker configuration uses. You can [see the query statements](https://docs.looker.com/data-modeling/learning-lookml/how-looker-generates-sql) in the SQL tab of a Look or Explore item. Try both ways and see which statements are more efficient. – O. Jones Jun 07 '22 at 10:36
  • 1
    Can you provide more of an example? Generally liquid templating should be extremely fast (orders of magnitude faster than the query execution itself), but evaluating case statements should also be trivially fast for the database, unless they involve correlated subqueries or impact joins in complex ways... liquid could also theoretically change caching behaviors and interact with looker in other ways, so you might just want to try it and see what happens – tconbeer Jun 07 '22 at 16:20

0 Answers0