villebro opened a new pull request, #23491:
URL: https://github.com/apache/superset/pull/23491

   ### SUMMARY
   PR #21163 introduced support for time grains to the base axis for both 
regular and adhoc columns. This caused a performance regression that executes a 
query to the analytical database for every adhoc column to check if it's a 
temporal expression or not.
   
   This PR changes the logic slightly so that the query is executed only if 
needed, i.e. the base column is adhoc and has a time grain.
   
   ### AFTER
   On a chart with two normal adhoc columns, the query now executes in 7 
seconds with only a single query being sent to the database:
   
   
![image](https://user-images.githubusercontent.com/33317356/227862791-fec19a17-b73d-4261-bfbd-aff45e251207.png)
   
   The same chart previously executed in 22 seconds (rougly 3 x 7 seconds with 
3 queries sent to the database):
   
   
![image](https://user-images.githubusercontent.com/33317356/227862961-df4811dc-dd90-4151-adb4-0d1ce657fda8.png)
   
   ### TESTING INSTRUCTIONS
   1. create a chart with multiple adhoc columns
   2. look at debug logs and notice an additional query being sent to the 
database for each adhoc column added
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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