Using PIVOT is looks and calling it using an API

Hi,
So we are using API calls to pull our looks onto the dashboard that was built using Vue.js.

When we make the API calls though most of the Looks are pretty fast the looks which use pivot in the looks donot work as fast as other looks.

My question is do i need to include a pivot table in those looks . If I unpivot the table wouldnt the API call still validate and pull the values

I think I get what you’re asking: When you query via the API, the result set you get is always unpivoted. But, queries that are pivoted in looker still return slower, even though they return the same result.

The reason for this is that when you run a query, you are running literally that query— Not an api-ified version of it that’s optimized for the method, not a smaller version, it’s the same exact query. We do not do pivoting on the front-end, so if you open the SQL tab on an explore with pivoted results, you’ll see some crazy looking SQL that’s doing all the pivoting.

For that reason, when you run an API call on a pivoted query, it’ll be a bit slower than an unpivoted one, since it has to actually run different SQL. Does that make sense? Let me know if I misunderstood