Question

How to avoid order by in Look SQL?

  • 12 July 2018
  • 3 replies
  • 214 views

Userlevel 2

I am using Looker with Google BigQuery and sometime reports are slow or throws resource exceed error due to order by clause. I also see post in discourse that suggests not to use order by for Google BigQuery SQLs but looker by default have order by clause and not able to find option to have order by optional to improve performance.


3 replies

Userlevel 3

Hi @kshah7,


Currently, the option to remove table sorting in Looker is only for downloads. You’ll see the checkbox in the download modal. All other queries will have an ORDER BY clause in SQL.

If you’d like to tell me a little more about your use case, I’d be happy to pass your feedback on to our product team!


Best,

Molly

Hi, I’m having the same issue, if I could remove completely the order by clause from the SQL and sort the results afterwards it could make it run faster.

Since this answer from 2 years ago is the most recent answer I found about his topic, I’d like to know if looker team have something new on this now.

Userlevel 6
Badge

I have not tested this, nor do I know if it’s an acceptable UX, but I am wondering if you could make a “Sort Prevention” measure, whose sql is just NULL or some other constant, and sort by that. Maybe your database would optimize that as no sorting?

Reply