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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.