dosubot[bot] commented on issue #33076:
URL: https://github.com/apache/superset/issues/33076#issuecomment-2792452453

   <!-- Answer -->
   When `OPTIMIZE_SQL` is set to `True` in Superset's feature flags, it changes 
the SQL query generation by moving filtering conditions from the outer query to 
the inner query, which might affect how time grain expressions are applied. 
This optimization is intended to improve query performance by applying 
predicate pushdown, specifically for virtual datasources 
<sup>[[1]](https://github.com/apache/superset/blob/master/tests/unit_tests/models/core_test.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset/config.py)</sup>.
 
   
   If you're experiencing issues with time grain expressions in MySQL when 
`OPTIMIZE_SQL` is enabled, it could be due to how these optimizations interact 
with the MySQL-specific time grain expressions. You might want to verify if the 
optimization is affecting the application of the `DATE_ADD` function in your 
queries.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/b850f359-0467-46ec-9063-36ad15bbcc36?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/b850f359-0467-46ec-9063-36ad15bbcc36?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/b850f359-0467-46ec-9063-36ad15bbcc36?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/b850f359-0467-46ec-9063-36ad15bbcc36?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/b850f359-0467-46ec-9063-36ad15bbcc36?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/b850f359-0467-46ec-9063-36ad15bbcc36?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/b850f359-0467-46ec-9063-36ad15bbcc36?feedback_type=other)</sup>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to