I'm trying to get rid of my join tables, in favor of a database design that is faster for large datasets. The way I'm planning to do this is to store the id's of children in the parent record. Like so:
Parents table:
id, child1_id, child2_id, child3_id,... child(100)_id
Children table:
id, grandchild1_id, grandchild2_id,... grandchild(100)_id
models:
Parent
has_many :children, :dependent => :destroy
accepts_nested_attributes_for :children
Child
belongs_to :parent
has_many :grandchildren, :dependent => :destroy
accepts_nested_attributes_for :grandchildren
Grandchild
belongs_to :child
My end result would be to be able to edit parent, children and grandchildren in the same form. This is already possible by using join tables, but I'm keen on boosting up performance
How can I get better performance for my database, when I depend on the functionality join tables provides? Please help, I've been searching the web for many days now :/ Thanks!