Forum Discussion
Hi peterlu
I think the real issue here is that you need to get a data point for 300 items. So maybe the problem could be seen in a different way, for example assuming that the board structure does not change often (which is a fair assumption in most scenarios), then you can do your 300 calls once, and cache the result at the application level for a suitable amount of time.
Thanks,
- peterlu11 years agoChampionPaoloT Cache will work. I am just curious about the possibility in API v2, since I am going to move my future dev work into v2. This user case has happened to many of my customers, so it is worth to bring it up :)
- PaoloT11 years agoLithium Alumni (Retired)
Hi peterlu
ah I see. A way to do that in an SQL-Like language would be to select a post count by board ID, having a category in the where clause and then grouping by the board ID. I don't think group by is currently available in LiQL - maybe worth pinging JeffY to see if this in in the plans (although I imagine it is a quite sizeable task to add this feature).
In the meantime, you could alway perform the aggregation in your code, having something like (where Cat1 and Cat2 are your categories)
SELECT id,board.id FROM messages WHERE category.id IN ('Cat1','Cat2');
And then paginate the result, which could be slightly more compact.
Kind Regards,
Related Content
- 3 years ago
- 2 years ago