Looker Side Optimization Techniques
Looker Side Optimization Techniques
1. Persist :
This is one of the optimization techniques where there is huge data or complex
calculations and filters, if data refreshes in a day or 2. This can be helpful.
I tried giving this in explore level and first time it loads with some time but
whenever users come to this dashboard, it won't wait to load but render in
seconds.
If user reload:
This won’t hit DB again to fetch. But the issue here is first time load will take some
time to load and if data is updated frequently this won’t work.
2. Removing Joins
Remove Redundant Joins: Ensure only necessary joins are included based on
the parameter conditions.
Simplify SQL Conditions: Consolidate SQL conditions and use simpler logic
where possible.
Use PDTs for Complex Joins: If certain joins are always needed and
computationally heavy, consider using PDTs.
On one view there are 7 Joins made in model level. As the data is huge its taking
time to load.
3. Extends replacement.
As global data is used Extends feature where another view is getting extended. i.e
all dimensions and measures also get combined with global data and huge
columns will be formed.
I tried to restrict not to use extends but tried to get from another view whatever
required. But, didn’t helped much.
If you see above screen, I have commented and tried to create dimensions getting
called vis its view name. But, didn’t worked as expected for the performance
improvement.
4. Case vs If conditional statements:
Time Dimension Logic: The way the fiscal_yr_mo dimension is determined based
on the plant_region and other parameters might lead to complex queries,
especially if there are many regions or parameter values.
View Dependencies: If the global_data view depends on other views that also
have complex logic or large datasets, it can lead to cascading slowness.
Explore Filters: Pre-filter the data based on user selections before performing
complex calculations. This can reduce the amount of data processed. This won't
work as we have filters separately in filter panel. Can’t fix static filters.
Indexes: Ensure proper indexes are created on the database columns used in the
LookML filters and aggregations. – This I haven’t tried as we need to fix with DB
person as well
Caching: Looker offers options for caching query results. Explore caching
strategies to improve performance for frequently accessed views.