Contribution Analytics: Remove batching when fetching data from clickhouse
Problem
We introduced batching of contribution analytics data into queries by week in order to prevent 500s when running on PG.
Now that we have clickhouse available, the batching is actually increasing the load time.
Solution
Remove the batching of queries as much as possible when fetching data from clickhouse.
Implementation idea: expose a new data attribute to the FE which specifies the DB engine (postgresql
or click_house
). Depending on the value, the FE could adjust the batching logic. By knowing the exact engine the FE can also add engine-specific messages to the UI. For example for click_house
we might add a note later: the data you see here is refreshed periodically (every few minutes).
Frontend implementation
- Read DB engine attribute on page load
- Adjust end date calculation based on DB engine
Edited by Ezekiel Kigbo