Jump to content

Efficient method for Partitioning a "Users" Table.


GB_001

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.