Feat: Allow for query of cumulative image weight#474
Conversation
This was requested by our stalwart mobile dev, and it does make a sort of sense - though I'm not 100% sure the metric will be totally accurate - it might be worthwhile making another issue for the actual TEXT weight on top of the media byte-sizes all summed together resolves #417
|
I tested this code locally, and it was quite slow to request the imageByteSum for the USA (21 seconds, with 81 MB as the result). it was much faster at the state level (<1 second with as much as 50 MB), so I think just getting all descendants at the country level is quite slow. I imagine this will mostly be used at the state level though, so probably not really a big deal. This looks good to me! |
|
Thanks for bench-marking it! yea it is brutally slow, but my hope is that users will have no reason to fetch this value unless they are doing cache lookahead, which shouldn't be every time (I hope) It could be sped up enormously by de-normalizing the field but the complexity of that approach is very much non-zero. The actual way to speed it up is to merge #428 which has a more performant implementation of our area structure and would eliminate the expensive regex needed in this approach |
This was requested by our stalwart mobile dev, and it does make a sort of sense - though I'm not 100% sure the metric will be totally accurate
resolves #417