Use joins instead of includes
What does this MR do and why?
Relates to #344278 (closed)
The old query had been reading extra columns before, which was a blocker for data tam as it always timed out/failed.
In this MR, we restrict the columns we read with the count operation using left_outer_joins
.
We validated this query with the data team (slack thread [Internal]) and works with their requirement. The output from the query is also the same as before with reduced loading of columns.
Query explain - https://console.postgres.ai/shared/b20e2d31-4523-4750-8dcb-ba90de96262f
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.