3 ms·
If it's not possible to do a few big queries to pull all the necessary base data (all the related Ys and Zs for the last 10,000 Xs) and then join/filter it your
by eschutte2 10y ago
If it's not possible to do a few big queries to pull all the necessary base data (all the related Ys and Zs for the last 10,000 Xs) and then join/filter it yourself in code, then I think you are stuck with many queries. The options I can think of are: 1) keep the logic in stored procedures; 2) find a way to fetch the raw data in a few large queries, then join yourself; 3) let the reports be slow and generate them in the background; 4) write one complex SQL query that does all the crunching (if possible, you're saying it's not).