MySQL·ÖÇø£¨Partition£©
MySQL·ÖÇø£¨Partition£©¹¦ÄÜÊÔÑé2008-07-06 20:02Ŀ¼
[¸ÅÊö]
[·ÖÇø±íºÍδ·ÖÇø±íÊÔÑé¹ý³Ì]
[·ÖÇøÃüÁîÏê½â]
[¸ÅÊö]
×Ô5.1¿ªÊ¼¶Ô·ÖÇø(Partition)ÓÐÖ§³Ö£¬6.0Ó¦±È½ÏÎȶ¨
= ˮƽ·ÖÇø£¨¸ù¾ÝÁÐÊôÐÔ°´Ðз֣©=
¾Ù¸ö¼òµ¥Àý×Ó£ºÒ»¸ö°üº¬Ê®Ä귢Ʊ¼Ç¼µÄ±í¿ÉÒÔ±»·ÖÇøΪʮ¸ö²»Í¬µÄ·ÖÇø£¬Ã¿¸ö·ÖÇø°üº¬µÄÊÇÆäÖÐÒ»ÄêµÄ¼Ç¼¡£
=== ˮƽ·ÖÇøµÄ¼¸ÖÖģʽ£º===
* Range£¨·¶Î§£© – ÕâÖÖģʽÔÊÐíDBA½«Êý¾Ý»®·Ö²»Í¬·¶Î§¡£ÀýÈçDBA¿ÉÒÔ½«Ò»¸ö±íͨ¹ýÄê·Ý»®·Ö³ÉÈý¸ö·ÖÇø£¬80Äê´ú£¨1980's£©µÄÊý¾Ý£¬90Äê´ú£¨1990's£©µÄÊý¾ÝÒÔ¼°ÈκÎÔÚ2000Ä꣨°üÀ¨2000Ä꣩ºóµÄÊý¾Ý¡£
* Hash£¨¹þÏ££© – ÕâÖÐģʽÔÊÐíDBAͨ¹ý¶Ô±íµÄÒ»¸ö»ò¶à¸öÁеÄHash Key½øÐмÆË㣬×îºóͨ¹ýÕâ¸öHashÂ벻ͬÊýÖµ¶ÔÓ¦µÄÊý¾ÝÇøÓò½øÐзÖÇø£¬¡£ÀýÈçDBA¿ÉÒÔ½¨Á¢Ò»¸ö¶Ô±íÖ÷¼ü½øÐзÖÇøµÄ±í¡£
* Key£¨¼üÖµ£© – ÉÏÃæHashģʽµÄÒ»ÖÖÑÓÉ죬ÕâÀïµÄHash KeyÊÇMySQLϵͳ²úÉúµÄ¡£
* List£¨Ô¤¶¨ÒåÁÐ±í£© – ÕâÖÖģʽÔÊÐíϵͳͨ¹ýDBA¶¨ÒåµÄÁбíµÄÖµËù¶ÔÓ¦µÄÐÐÊý¾Ý½øÐзָÀýÈ磺DBA½¨Á¢ÁËÒ»¸öºá¿çÈý¸ö·ÖÇøµÄ±í£¬·Ö±ð¸ù¾Ý2004Äê2005ÄêºÍ2006ÄêÖµËù¶ÔÓ¦µÄÊý¾Ý¡£
* Composite£¨¸´ºÏģʽ£© - ºÜÉñÃØ°É£¬¹þ¹þ£¬ÆäʵÊÇÒÔÉÏģʽµÄ×éºÏʹÓöøÒÑ£¬¾Í²»½âÊÍÁË¡£¾ÙÀý£ºÔÚ³õʼ»¯ÒѾ½øÐÐÁËRange·¶Î§·ÖÇøµÄ±íÉÏ£¬ÎÒÃÇ¿ÉÒÔ¶ÔÆäÖÐÒ»¸ö·ÖÇøÔÙ½øÐÐhash¹þÏ£·ÖÇø¡£
= ´¹Ö±·ÖÇø£¨°´Áз֣©=
¾Ù¸ö¼òµ¥Àý×Ó£ºÒ»¸ö°üº¬ÁË´ótextºÍBLOBÁÐµÄ±í£¬ÕâЩtextºÍBLOBÁÐÓÖ²»¾³£±»·ÃÎÊ£¬Õâʱºò¾ÍÒª°ÑÕâЩ²»¾³£Ê¹ÓõÄtextºÍBLOBÁË»®·Öµ½ÁíÒ»¸ö·ÖÇø£¬ÔÚ±£Ö¤ËüÃÇÊý¾ÝÏà¹ØÐÔµÄͬʱ»¹ÄÜÌá¸ß·ÃÎÊËٶȡ£
[·ÖÇø±íºÍδ·ÖÇø±íÊÔÑé¹ý³Ì]
*´´½¨·ÖÇø±í,°´ÈÕÆÚµÄÄê·Ý²ð·Ö
mysql> CREATE TABLE part_tab ( c1 int default NULL, c2 varchar(30) default NULL, c3 date default NULL) engine=myisam
PARTITION BY RANGE (year(c3)) (PARTITION p0 VALUES LESS THAN (1995),
PARTITION p1 VALUES LESS THAN (1996) , PARTITION p2 VALUES LESS THAN (1997) ,
PARTITION p3 VALUES LESS THAN (1998) , PARTITION p4 VALUES LESS THAN (1999) ,
PARTITION p5 VALUES LESS THAN (2000) , PARTITION p6 VALUES LESS THAN (2001) ,
PARTITION p7 VALUES LESS THAN (2002) , PARTITION p8 VALUES LESS THAN (2003) ,
PARTITION p9 VALUES LESS THAN (2004) , PARTITION p10 VALUES LESS THAN (2010),
PARTITION p11 VALUES LESS THAN MAXVAL
Ïà¹ØÎĵµ£º
1£® °²×°Cygwin
ÔËÐÐCygwinµÄ°²×°³ÌÐò¡£´ÓÎļû°üµÄµÄÁбíÖУ¬ÔÚDEVÀïÃ棬ȷ¶¨ÒªÑ¡Ôñ
• Ruby
• gcc
• subversion
ÄãÐèҪʹÓÃgccÀ´½¨Á¢Cygwin°æ±¾µÄMySQL.
2. ÔÚwindowsÉÏÃæ°²×°MYSQL£º
download MySQL 5.0 Windows Installer
3£® & ......
MySQLÓжàÖÖ´æ´¢ÒýÇ棺
MyISAM¡¢InnoDB¡¢MERGE¡¢MEMORY(HEAP)¡¢BDB(BerkeleyDB)¡¢EXAMPLE¡¢FEDERATED¡¢ARCHIVE¡¢CSV¡¢BLACKHOLE¡£
MySQLÖ§³ÖÊý¸ö´æ´¢ÒýÇæ×÷Ϊ¶Ô²»Í¬±íµÄÀàÐ͵Ĵ¦ÀíÆ÷¡£MySQL´æ´¢ÒýÇæ°üÀ¨´¦ÀíÊÂÎñ°²È«±íµÄÒýÇæºÍ´¦Àí·ÇÊÂÎñ°²È«±íµÄÒýÇ棺
¡ô MyISAM¹ÜÀí·ÇÊÂÎñ±í¡£ËüÌṩ¸ßËÙ´æ´¢ºÍ¼ìË÷£¬ÒÔ¼°È«ÎÄËÑË÷ÄÜÁ¦¡ ......
C#Á¬½ÓMySQLÊý¾Ý¿â·½·¨
1¡¢ÓÃMySQLDriverCSÁ¬½ÓMySQLÊý¾Ý¿âÏÈÏÂÔغͰ²×°MySQLDriverCS£¬µØÖ·£º
http://sourceforge.net/projects/mysqldrivercs
ÔÚ°²×°Îļþ¼ÐÏÂÃæÕÒµ½MySQLDriver.dll£¬È»ºó½«MySQLDriver.dllÌí¼ÓÒýÓõ½ÏîÄ¿ÖÐ
×¢£ºÎÒÏÂÔصÄÊÇ°æ±¾ÊÇ MySQLDriverCS-n-EasyQueryTools-4.0.1-DotNet2.0.exe
using System; ......
ÍøÕ¾µÄÊý¾Ý¿âÊǵ÷ÓÃÔ¶³Ì·þÎñÆ÷ÉϵÄ,²»ÊDZ¾»úµÄ.ÍøÕ¾´ò¿ª±È½ÏÂý.ÔÚÍøÉÏËÑË÷ÁË·½·¨,Õâ¸ö·½·¨¿ÉÒÔ½â¾ö,µ«ÊÇÓÐÁíÍâµÄÎÊÌâ³öÏÖ:
-----------------------------------------------------------------------
ÔÚ¾ÖÓòÍøÄÚÁ¬½ÓÆäËû»úÆ÷µÄMYSQL,·¢ÏÖËÙ¶ÈÂýµÄºÜ,²»ÖªµÀʲôÔÒò,×ÜÓм¸ÃëµÄÑÓ³Ù.
ºóÀ´ÔÚÍøÉÏ·¢ÏÖ½â¾ö·½·¨,my.iniÀïÃæÌ ......