3 ms·
many of these which can be extremely difficult in imperative, can be very easy in declarative.
by deepstack 5y ago
many of these which can be extremely difficult in imperative, can be very easy in declarative.
- marginalia_nu 5y agoSQL was built to do this type of operation. It's generally a better pattern to fetch the data you need, rather than fetch all the data and then to transform it into what you need in the code.
- deepstack 5y agoand Prologo will be even better and cleaner syntax.
- alexchantavy 5y agoI'm actually working on a similar problem right now so I appreciate your comments. What if the data is already in the Python process so I don't have the ability of doing a `group by` at the database level? Should I perform this functionality in the Python code itself, or should I write to another database table and do the `group by` there? Edit: upon further reflection I think my application is at the tipping point where it needs another database table.
- marginalia_nu 5y agoDepending on your database, perhaps a materialized view is in order?