Hi, Creating multiple tables is not the key to solve this problem. If your rows are higher than 10 million records, then you have to make sure you archive the older ( Unused ) rows or solve it through MASTER - SLAVE db approach.
Ideally when you're worry about performance issues with databases , it depends on the READ/WRITE speed expected from the db. And how often is the data being stored READ ? Cheers Vivek On Sun, Oct 12, 2014 at 7:02 AM, Yongbiao Long <longyongb...@gmail.com> wrote: > Hi, everyone, > > I've learned Rails(Web development) on my own for two months, and came to > a situation like this: > > There are two tables A and B in my database. A 'has_many` B. For every > user input, There is an entry in table A. At the same time, I need to add a > huge number(say 100,000) of entries in B. As table A grows, table B seems > to grow uncontrollably. There must be performance issues in later data > manipulation operations, or even 'overflow` problems. I use Mysql. > > My initial thought was to split table B, for example, for every entry in > table A, create a new table (on the fly) for it. The questions are: > > Is my thought right? > If yes, then how to design the models and migrations to represent the > relationship correctly? > If not, what are good practices to solve this kind of problem? > > I'd be very grateful if you could only give some hints, doc or good > articles about it. > > -- > Best Regards > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscr...@googlegroups.com. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CALDAArrsvWhbQ-VXkx-Xj2B16zJbC%2Bg%2BcQpy_S68vO4sJCJG4g%40mail.gmail.com > <https://groups.google.com/d/msgid/rubyonrails-talk/CALDAArrsvWhbQ-VXkx-Xj2B16zJbC%2Bg%2BcQpy_S68vO4sJCJG4g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAFKVRj_d-%2BH0UtZZ_ukAd-bdn3d36yOStin%3DFuxTJtn4uroXLQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.