<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>深蓝的blog &#187; partition</title>
	<atom:link href="http://www.lanxinbase.com/?feed=rss2&#038;tag=partition" rel="self" type="application/rss+xml" />
	<link>http://www.lanxinbase.com</link>
	<description>记录日常生活</description>
	<lastBuildDate>Sat, 18 Apr 2026 07:10:07 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.3</generator>
	<item>
		<title>了解一下mysql分区示例（partition）</title>
		<link>http://www.lanxinbase.com/?p=1934</link>
		<comments>http://www.lanxinbase.com/?p=1934#comments</comments>
		<pubDate>Mon, 06 Aug 2018 02:45:57 +0000</pubDate>
		<dc:creator><![CDATA[Alan]]></dc:creator>
				<category><![CDATA[3.数据库相关]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[partition]]></category>

		<guid isPermaLink="false">http://www.lanxinbase.com/?p=1934</guid>
		<description><![CDATA[一.数据分区

mysql数据库中的数据是以文件的形式存储在磁盘介质上，具体存储目录，请查阅“my.cnf”中的“datadir”属性。一张数据表主要对应着三个文件，一个是FRM存放表结构的，一个是MYD存放表数据的，一个是MYI存表索引的。如果一张表的数据量太大的话，那么MYD、MYI就会变的很大，查找数据就会变得很慢，这个时候可以利用mysql的分区功能，在物理上将这一张表对应的三个文件，分割成许多个小块，这样做的话，我们查找一条数据时，就不用全部查找了，只要知道这条数据在哪一块，然后在那一块找就行了。如果表的数据太大，可能一个磁盘放不下，这个时候，我们可以把数据分配到不同的磁盘里面去。

1.横向分区

就是横着来分区，举例：假如有100W条数据，分成十份，前10W条数据放到第一个分区，第二个10W条数据放到第二个分区，依此类推。也就是把表分成了十分，根用merge来分表，有点像哦。取出一条数据的时候，这条数据包含了表结构中的所有字段，也就是说横向分区，并没有改变表的结构。

2.纵向分区

什么是纵向分区呢？就是竖来分区了，举例来说明，在设计用户表的时候，开始的时候没有考虑好，而把个人的所有信息都放到了一张表里面去，这样这个表里面就会有比较大的字段，如个人简介，而这些简介呢，也许不会有好多人去看，所以等到有人要看的时候，在去查找，分表的时候，可以把这样的大字段，分开来。

mysql提供的分区属于第一种，横向分区，并且细分成很多种方式]]></description>
		<wfw:commentRss>http://www.lanxinbase.com/?feed=rss2&#038;p=1934</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
