Posted By

Eloi on 05/05/09


Tagged

mysql performance users vertical partitioning


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

Eloi
nerdfiles
kubaitis


Create Table Users


 / Published in: MySQL
 

Splitting table users in frequently and infrequently accessed attributes

  1. CREATE TABLE Users (
  2. user_id INT NOT NULL AUTO_INCREMENT,
  3. email VARCHAR(80) NOT NULL,
  4. display_name VARCHAR(50) NOT NULL,
  5. password CHAR(41) NOT NULL,
  6. PRIMARY KEY (user_id),
  7. UNIQUE INDEX (email)
  8. ) ENGINE=INNODB;
  9.  
  10.  
  11. CREATE TABLE UsersExtra (
  12. user_id INT NOT NULL,
  13. first_name VARCHAR(25) NOT NULL,
  14. last_name VARCHAR(25) NOT NULL,
  15. address VARCHAR(80) NOT NULL,
  16. city VARCHAR(30) NOT NULL,
  17. province CHAR(2) NOT NULL,
  18. postcode CHAR(7) NOT NULL,
  19. interests TEXT NULL,
  20. bio TEXT NULL,
  21. signature TEXT NULL,
  22. skills TEXT NULL,
  23. PRIMARY KEY (user_id),
  24. FULLTEXT KEY (interests, skills)
  25. ) ENGINE=MyISAM;

Report this snippet  

You need to login to post a comment.