I am trying to create a derived table with SQL which involves using a liquid condition in the SQL. I used a inner join to join the base table with a date table to use {%condition Date.startdate_Date%}Date.AsofDate{%endcondition%}
Using this makes the query run for 30 seconds when i run it. If i take the SQL out and make it run without the inner join while using the same dates it will take me less than 2 seconds to get the results for the same filters.
Any idea how i can rebuild the derived table