4 ms·
> but that means 8 joins to fetch data Without seeing your schema, that sounds like a bit much, but maybe not. That is kind of the point of a relational DB. I
by sgarland 2y ago
> but that means 8 joins to fetch data
Without seeing your schema, that sounds like a bit much, but maybe not. That is kind of the point of a relational DB.
I always attempt to normalize as high as possible first, and then denormalize IFF it’s necessary for performance. Postgres has a default join limit (i.e. where it shifts to the genetic algorithm for joins, and may not be optimal) of 8, but I’ve still seen it do fine far above that.
- magicalhippo 2y agoIf we normalized as much as possible we'd be looking at 20-30 joins just for the main view of a declaration. Main overview grid would have probably 10+ joins. And keep in mind almost all of these would have data, so instead of inserting one row you're now inserting 20-30 rows + updating corresponding foreign key indexes. Think performance would be pretty crap, and developer experience as well.