GB_001 Posted March 14, 2011 Share Posted March 14, 2011 Hi, I'm working on a project which may be trying if it had alot of users and I'm wondering if this is an efficient way to partition the tables: Short Story of what I did: I converted the usernames into "numbers" using an algorithm, then found the standard deviation and the highest number using a random name generator and another algorithm I made. After that I made the table code and partitioned by range using the standard deviation, with this I was able to get 10 partitions. Do you think this would be efficient enough if I had say 50 million user entries? example: mysql_query("CREATE TABLE XXXXX ( ID INT AUTO_INCREMENT PRIMARY KEY, XXXXXXX VARCHAR(32), XXXXX VARCHAR(32), XXXXX TEXT, XXXXXXX VARCHAR(32), XXXX INT, ) ENGINE = MYISAM PARTITION BY RANGE(XXXXX) ( PARTITION p0 VALUES LESS THAN(40), PARTITION p1 VALUES LESS THAN(80), PARTITION p2 VALUES LESS THAN(120), PARTITION p3 VALUES LESS THAN(160), PARTITION p4 VALUES LESS THAN(200), PARTITION p5 VALUES LESS THAN(240), PARTITION p6 VALUES LESS THAN(280), PARTITION p7 VALUES LESS THAN(320), PARTITION p8 VALUES LESS THAN(360), PARTITION p9 VALUES LESS THAN(MAXVALUE) )"); Thankyou, GB. Quote Link to comment https://forums.phpfreaks.com/topic/230567-efficient-method-for-partitioning-a-users-table/ Share on other sites More sharing options...
fenway Posted March 14, 2011 Share Posted March 14, 2011 What makes you think you need to partition this table? Quote Link to comment https://forums.phpfreaks.com/topic/230567-efficient-method-for-partitioning-a-users-table/#findComment-1187371 Share on other sites More sharing options...
GB_001 Posted March 14, 2011 Author Share Posted March 14, 2011 What makes you think you need to partition this table? Just in case I have alot of entries, it's just a precaution to prevent query slowdowns because this table will be accessed the most. Quote Link to comment https://forums.phpfreaks.com/topic/230567-efficient-method-for-partitioning-a-users-table/#findComment-1187427 Share on other sites More sharing options...
fenway Posted March 15, 2011 Share Posted March 15, 2011 50M is nothing. Quote Link to comment https://forums.phpfreaks.com/topic/230567-efficient-method-for-partitioning-a-users-table/#findComment-1187905 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.