Open lache-melvin opened 4 months ago
If we're looking at these views, might be cool to look into how we handle the different invoice types, see James' idea: https://github.com/msupply-foundation/open-msupply/pull/4453#discussion_r1692506886
Refinement: yes later, should be low impact for foreseeable future
In consumption/replenishment/adjustment views, add CROSS JOIN:
Think it might be better to be more explicit that this is a CROSS JOIN? That syntax to be supported in both postgres and SQLite. This scares me a little, if we have a 40,000 stores and 1000 items this join would consider 40,000,000 rows!
I think this is kind of the only want to make sure we have 0 consumption showing for any items and stores with no transactions. I assume that's what we need?
We could potentially limit the stores/items to ones that are visible on the site or something? Would potentially impact central server too.
In theory this view shouldn't be queried in its entirety but thought it was worth pointing out.
Is this is a performance risk for future?
_Originally posted by @jmbrunskill in https://github.com/msupply-foundation/open-msupply/pull/4453#discussion_r1692279039_