ãçªç¶ãMySQLç¨ã®VPã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ãæ°ã«ãªã£ãã®ã§è©¦ãã¦ã¿ã¾ããã
VP(Vartical Partitioning)ã¨ã¯ãæåéããã¼ãã«ã®ç¸¦åå²ã®ãã¨ã§ãã«ã©ã ããã£ã±ããããã¼ãã«ããããµãªã¨ç¸¦ã«åã£ã¦ï¼ãã¡ããPRIMARY KEYã®ã«ã©ã ã¯ä¸¡æ¹ã«æã¡ã¾ããï¼å¥ã
ã®ãã¼ãã«ã«åãã¦ç®¡çããã¨ãããã®ã
ãããã ããªãããã¼ãã«ãåå²ãããã¨ã§ãã¢ããªã±ã¼ã·ã§ã³ã®ã»ãã§å¿
ã両æ¹ã®ãã¼ãã«ã®æ´åæ§ãä¿ã¦ãããã«è¿½å ï¼åé¤ï¼æ´æ°ãããã°è¯ãã ããªã®ã§ããããã ããã¨ã¯è¨ã£ã¦ãããã¯çµæ§é¢åãVPã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã使ãã¨å
ã®ãã¼ãã«ã¬ã¤ã¢ã¦ãã®ã¾ã¾ã§ãã¢ã¯ã»ã¹ãããã¨ãã§ããã®ã§ãï¼è¦ªãã¼ãã«ï¼åãã¼ãã«ç¾¤ çã«èããã¨ã¤ã¡ã¼ã¸ããããããã§ããããï¼ã
ãã¾ãã¯è©¦ãã¦ã¿ã¾ããWindowsä¸ã§ç´°ãããã¨ã¯æ°ã«ããã«ããã£ã¨*1ã
http://spiderformysql.com/download_spider.html
ãããSpider 2.26 ã®
mysql-5.5.14-spider-2.26-vp-0.15-win32.zip
vp-init-0.15-for-5.5.14.tgz
ãè½ã¨ãã¦ã¢ã¼ã«ã¤ããå±éãã¾ãã
ãã³ãã³ãããã³ããã§å±éãããã£ã¬ã¯ããªã«ç§»åãã¦ã
D:\MyDir> bin\mysqld
ããå®è¡ãã·ã³ãã«ã«ã·ã³ãã«ã«(ç¬)ã
ããã㧠MySQL ãµã¼ããåä½ãã¦ãã¾ãã
ãããã²ã¨ã¤ã³ãã³ãããã³ãããéãã¦ãåããã£ã¬ã¯ããªã«ç§»åãã¦ã
D:\MyDir> bin\mysql -uroot
ãã§ã¯ã©ã¤ã¢ã³ããå®è¡ãã¾ãã
ãã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã確èªãã¦ã¿ãã¨ãVPã¨ã³ã¸ã³ã¯ã¾ã ããã¾ããã
mysql> show engines; +--------------------+---------+------------//-+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+------------//-+--------------+------+------------+ | CSV | YES | CSV storag.. | NO | NO | NO | | PERFORMANCE_SCHEMA | YES | Performanc.. | NO | NO | NO | | InnoDB | DEFAULT | Supports t.. | YES | YES | YES | | MyISAM | YES | MyISAM sto.. | NO | NO | NO | | MRG_MYISAM | YES | CollectionA.. | NO | NO | NO | | MEMORY | YES | Hash based... | NO | NO | NO | +--------------------+---------+---------------+--------------+------+------------+ 6 rows in set (0.00 sec)
ãVPã¨ã³ã¸ã³ã¯èªåã§è¨å®ããå¿
è¦ãããã¾ãã
ããã²ã¨ã¤è½ã¨ãã¦ãããã¡ã¤ã«ãå±éãã¦ãåºã¦ãã install_vp.sql ãå®æ½ãã¾ãã
æ¢åæã®å¯¾å¿ã¨ãOSã®å¤å®ã¨ãè²ã
ãã£ã¦ãã¾ãããè¦ããã« Windows ä¸ã§åãã¦è¨å®ãããªãã°ã以ä¸ã®ï¼ã¤ã®ãã¨ããã£ã¦ããã ãã§ã
install plugin vp soname 'ha_vp.dll'; create function vp_copy_tables returns int soname 'ha_vp.dll';
ããããããã®ããOSå¤å®ãæ¢åå¤å®ãªã©ããã¦ããä¸è¨ã³ãã³ããå®è¡ããããã«ãã¹ãã¢ãããã·ã¸ã£ã使ã£ã¦ããç¹ã§ãã
å¾æ¥ãªãã°ã·ã§ã«ã¹ã¯ãªãããããããã¡ã¤ã«ããã®å½¹å²ãæ
ã£ã¦ããã®ã§ãããããã©ããã¹ãã¢ãããã·ã¸ã£ã«ãããã¨ã§ãOSã®å£æ ¹ãè¶ãã¦ãMySQLä¸ã§åãã¹ã¯ãªãããåä½ããã®ã§ãããããã·ã¸ã£ãä½æãã¦ãå®è¡ãã¦ãããã«æ¶ããã¨ããå¦çãããã® install_vp.sql ã«ã¯è¨è¿°ããã¦ãã¾ãã
ãã¨ãããã¨ã§ãä¸è¨ï¼ã³ãã³ããä»åã¯æåã§å®è¡ãã¦ãããæ¹ãã¦ã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ç¶æ³ãè¦ã¦ã¿ã¾ãã
(ç¥) | VP | YES | Vertical Pa.. | YES | YES | NO | +--------------------+---------+---------------+--------------+------+------------+ 7 rows in set (0.00 sec)
ãã§ãã¾ãããã§ãã¾ãããã
æ©éãµã³ãã«ã®ãã¼ãã«ãä½ã£ã¦ã¿ã¾ãã
mysql> use test mysql> CREATE TABLE a1 (id integer, c01 varchar(255), c02 varchar(255), c03 varchar(255), PRIMARY KEY (id)) engine=innodb; mysql> CREATE TABLE a2 (id integer, c02 varchar(255), c04 varchar(255), c05 varchar(255), PRIMARY KEY (id)) engine=innodb; mysql> CREATE TABLE aall (id integer, c01 varchar(255), c02 varchar(255), c03 varchar(255), -> c04 varchar(255), c05 varchar(255), PRIMARY KEY(id)) -> engine=vp comment 'table_name_list "a1 a2"';
ãã§ãã¾ããããã¼ã¿ç»é²ã
mysql> INSERT INTO aall VALUES (10, "col1", "col2", "col3", "col4", "col5"); mysql> INSERT INTO aall VALUES (20, "colA", "colB", "colC", "colD", "colE");
mysql> SELECT * FROM aall; SELECT * FROM a1; SELECT * FROM a2; +----+------+------+------+------+------+ | id | c01 | c02 | c03 | c04 | c05 | +----+------+------+------+------+------+ | 10 | col1 | col2 | col3 | col4 | col5 | | 20 | colA | colB | colC | colD | colE | +----+------+------+------+------+------+ 2 rows in set (0.00 sec) +----+------+------+------+ | id | c01 | c02 | c03 | +----+------+------+------+ | 10 | col1 | col2 | col3 | | 20 | colA | colB | colC | +----+------+------+------+ 2 rows in set (0.00 sec) +----+------+------+------+ | id | c02 | c04 | c05 | +----+------+------+------+ | 10 | col2 | col4 | col5 | | 20 | colB | colD | colE | +----+------+------+------+ 2 rows in set (0.00 sec)
ããããã«åããã¦ããã¦ãã¾ãããc02ã«ã©ã ãéè¤ï¼a1,a2両æ¹ã®ãã¼ãã«ã«å«ã¾ãã¦ããï¼ãã¦ãã¾ããããã¡ãã¨ä¸¡æ¹ã«åããã®ãå
¥ãã¦ããã¦ãã¾ãã
aallãã¼ãã«ã«ã¢ã¯ã»ã¹ãã¦ããã°ãããããä»ã¾ã§ã¨ä½ãå¤ãããªããã®ããã«å©ç¨ã§ãã¾ãã
ã»ã¬ã¬ã·ã¼ãªè¨è¨ã§ãã«ã©ã æ°ãè¨å¤§ãªï¼æ¨ªã«é·ãï¼ãã¼ãã«ãªã©ããããã§åå²ç®¡çã§ãã
ã»ã¾ãã¯åå²ãããã©ãä½ãèããã«ãã¨ã®ã¬ã¤ã¢ã¦ãããã¨ã®ååã§ã¢ã¯ã»ã¹ã§ããããã«ããã®ã第ä¸æ®µéããª
ã»åå²å¾ã®ãã¼ãã«ã®ä¸é¨ã spider ã¨ã³ã¸ã³ã§å¥ã®ãã³ã«é£ã°ããã¨ãã§ããã
ã»èªã¿è¾¼ã¿å¦çã¯ãã³ã³ãã¯ãã«ãªã£ãåãã¼ãã«å´ã®ã»ãããè¡ãããã«,ããã°ã©ã ãå¤æ´ãã¦å¹¸ãã«ãªãã·ã¼ã³ããããããããªã
ã»ãã¥ã¼ã¨ã®éãã¯ãåãã¼ãã«å´ã®ã»ããå®ãã¼ãã«ãªã®ã§æ¸ãè¾¼ã¿ãã§ããããèªã¿è¾¼ã¿ã®éã®ã¡ã¢ãªå æéãã³ã³ãã¯ãã«ãªããã
æ´åæ§ãªã©ã«ã¤ãã¦æ°ã«ãªãã®ã§ãå¾ã»ã©å®é¨ãã¦ã¿ããã¨æãã¾ãã
.