Originally Posted by cwik Originally Posted by

2. This is a bit more complicated. My database actually holds already aggregated data. For every unit (card, pack, piece of equipment, etc) and currency there is zero to one entry per day. Every entry holds aggregated data like min, max, median, average. Before I started using this data model, I had saved every single sale, which made it impossible to calculate median values over.



I'm currently not using the median values for statistics nor histories as I'm not sure how to use those values in my sql aggregations. My statistics endpoint basically aggregates over the whole data while histories allow you to specify a size how much data should be combined (step parameter). To come to my point, I can either aggregate an average of daily median values or a median of daily median values. In both cases I'm not entirely sure as to how useful that piece of information is.



Besides I'm not even sure if I want to deal with medians on database level ever again, as it simply does not scale in the long run. As soon as set 4 hits, there probably is no need for median values anyway. But providing an average of daily median values should be quite easy and somewhat proficient.