When you have 4 tables like this:
Parent
Child
Grandchild
Great Grandchild
Do you tend to put a List of Great Grandchildren on the Parent and Child? It makes the workflow take longer when creating the great grandchildren and it makes the database busier, but it makes searches and conditions that much simpler to create and understand.
It seems that although itās not considered best practice to duplicate data in a database, people are doing things like this because of Bubbleās speed issues:
Iām still not sure if the same logic would apply to my ālistā idea, but it seems to make sense. Please weigh in if Iām wrong, but for now, I think Iāll go for it. Cheers, Phil
Since my initial post, weāve more judiciously picked where we duplicate the FK fields in grandparent -> child tables. Basically, now there needs to be a good reason for us to do it. For example, we have a few tables that are 3 levels deep, and which render data to the User. For those, weāve included the grandparent FK in the child tables, because we want the UI to be performant. Everywhere else, we take the performance hit.