Hi, there. I was wondering if it's possible to have one controller and view that has multiple tables. Let say there are 10 schools. Each school has a table to stores students' info. So one Student controller with 10 tables. Is it possible or any workaround? Thanks in advances.
Ichiro Saga wrote:
Hi, there. I was wondering if it's possible to have one controller and view that has multiple tables. Let say there are 10 schools. Each school has a table to stores students' info. So one Student controller with 10 tables. Is it possible or any workaround?
That's a terrible setup. You should never have multiple identical tables -- instead, all you need is one table for all students.
Thanks in advances.
Best,
Marnen Laibow-Koser wrote:
Ichiro Saga wrote:
Hi, there. I was wondering if it's possible to have one controller and view that has multiple tables. Let say there are 10 schools. Each school has a table to stores students' info. So one Student controller with 10 tables. Is it possible or any workaround?
That's a terrible setup. You should never have multiple identical tables -- instead, all you need is one table for all students.
Thanks in advances.
Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org
Thanks Maren. When there are 30+ schools and each has 100k+ students, it'll be a very large table. That's why I was thinking about breaking it into some smaller tables.
Ichiro Saga wrote:
That's why I was thinking about breaking it into some smaller tables.
Don't. A few 100k or million rows are nothing for a database. As long as you set up an index for the school_id, splitting the students in multiple tables has absolutely no advantage.
Andreas S. wrote:
Ichiro Saga wrote:
That's why I was thinking about breaking it into some smaller tables.
Don't. A few 100k or million rows are nothing for a database. As long as you set up an index for the school_id, splitting the students in multiple tables has absolutely no advantage.
Right. If you *must* break the table (which you probably won't even need to do), then use your DB's sharding features (such as MySQL's MERGE tables) so that it still functions like one huge table.
Best,
I second everybody else here. Add an identifier for the school in your table and you'll be happier than with the setup you were going to use.