Splitting up a large mySql table into smaller ones - is it worth it? -



Splitting up a large mySql table into smaller ones - is it worth it? -

i have 28 1000000 records import mysql database. record contains personal info members in , searchable states.

my question is, more efficient break table smaller tables opposed keeping in 1 big table? had in mind split them 50 seperate tables representing 50 states this: members_ca, members_az, members_tx, etc;

this way query this:

'select * members_' . $_post['state'] . ' members_name "john doe" ';

this way have deal info given state @ once. intuitively makes lot of sense curious hear other opinions.

thanks in advance.

i posted comment i'll post reply now.

never, ever think of creating x tables based on difference in attribute. that's not how things done.

if table have 28 1000000 rows, think of partitioning split smaller logical sets.

you can read partitioning @ mysql documentation.

the other thing choosing right db design , choosing indexes properly.

the 3rd thing avoid terrible thought of using $_post straight in query, wouldn't want inject sql , drop database, tables or not.

the final thing choosing appropriate hardware task, don't want such app running on vps 500 mb of ram or 1 gig of ram.

mysql

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -