Fork me on GitHub
#sql
<
2022-03-20
>
orestis14:03:54

Am I overthinking many-to-many NxM relationships where N could be in the tens of thousands and M can be in the hundreds? Where most of the time the addition of a single M could add tens-of-thousands of rows in the table?

orestis14:03:27

I mean, this is a textbook many-to-many relationship table and the various indexes will probably take care of performance considerations...

kenj22:03:32

What kind of queries will be run against that table, and what is the max query time you need to support? In general your DB will handle that fine, but maybe your queries will not run sub 100ms

kenj22:03:18

At least that's been my experience on Postgres

orestis01:03:39

Sub 100ms queries are important. I guess I can always denormalize and use eg arrays, even automatically with triggers…