3 ms·
Storing such data structure would be binding to a single access pattern, I agree. But a query to retrieve such structure is simply convoluted for no reason to t
by LudwigNagasena 2y ago
Storing such data structure would be binding to a single access pattern, I agree. But a query to retrieve such structure is simply convoluted for no reason to the point of many people resorting to hacks like json_agg.
- liontwist 2y agoMake a SQL view for the tree and a function in the client application which can read a tree in its linear projected form.
- LudwigNagasena 2y agoIf SQL were flexible, I wouldn’t need to create a whole view for a single query.
- liontwist 2y agoYou’re telling me there are two presentations of reviews (by restaurant and by user) but it’s too much work to define a query for those two views. I guess your app can just not support that feature and keep the tree? What do you want to hear?