<?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>On the way to perfect computing &#187; databases</title>
	<atom:link href="http://blog.alexzender.com/category/databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexzender.com</link>
	<description>Just another bunch of coding thoughts by Alexander Vushkan</description>
	<lastBuildDate>Tue, 02 Jun 2009 13:26:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Inside MySQL</title>
		<link>http://blog.alexzender.com/2008/02/24/inside-mysql/</link>
		<comments>http://blog.alexzender.com/2008/02/24/inside-mysql/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 22:18:13 +0000</pubDate>
		<dc:creator>Alexander Vushkan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[internals]]></category>

		<guid isPermaLink="false">http://blog.alexzender.com/?p=23</guid>
		<description><![CDATA[Majority of us knows that databases are read-optimized products and most of them are not optimized for writes. In this post I would like to describe what&#8217;s going on under the hood of mysql that can help us to find origins of some well-known rules. So, let&#8217;s start with MySQL MyIsam table: - MyIsam tables [...]]]></description>
			<content:encoded><![CDATA[<p>Majority of us knows that databases are read-optimized products and most of them are not optimized for writes.</p>
<p>In this post I would like to describe what&#8217;s going on under the hood of mysql that can help us to find origins of some well-known rules.</p>
<p>So, let&#8217;s start with MySQL MyIsam table:</p>
<p>- MyIsam tables caches only key data structures in memory and let OS caching mechanism to cope with data. Truly, particularly Linux is good at it at some point(Also MyIsam has read-ahead buffer for data). So, if insert/update query updates key data structure, MyIsam will flush key data on the disk. It slows down a whole process. To avoid this you can tweak mysql&#8217;s configuration to delay key writes.</p>
<p>- MyIsam comes with a very simple locking mechanism &#8211; it&#8217;s its table-level locking. So, when user writes data, another one won&#8217;t be able to read any row till the end of transaction. Okay, you can say, if insert time is relatively short, we can wait. So, let us see how MyIsam inserts record into a table: Firstly, it scans a table area and tries to find previously deleted row and re-use its room. If no deleted row was found, it appends data to the end of the table. So, if the space is not as important as execution time, you can speed it up telling database to append data to the end of table immediately and disable scans.</p>
<p>For the bulk data management, it&#8217;s good to create a table without indices first and import data. Once the import process is finished you can create indices. If you need to append large amount of data to production machine, you can do hot replacement:  prepare such table and send signal to application to use another table instead of old one(the type of signal depends on your application architecture: IPC, record in database with polling on application side,etc)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexzender.com/2008/02/24/inside-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full-Text Search in MySql and the Minimum Indexed Word Length</title>
		<link>http://blog.alexzender.com/2008/02/12/full-text-search-in-mysql-and-the-minimum-indexed-word-length/</link>
		<comments>http://blog.alexzender.com/2008/02/12/full-text-search-in-mysql-and-the-minimum-indexed-word-length/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 11:17:32 +0000</pubDate>
		<dc:creator>Alexander Vushkan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[databases]]></category>

		<guid isPermaLink="false">http://blog.alexzender.com/?p=17</guid>
		<description><![CDATA[MySql comes with extremely useful feature full-text search. The minor thing that bored me was the minimum word length that mysql can index to. It was 4 letters by default on my machine. To change the value to desired one you need to: set ft_min_word_len variable up in my.ini file restart mysql ensure that the [...]]]></description>
			<content:encoded><![CDATA[<p>MySql comes with extremely useful feature full-text search.  The minor thing that bored me was the minimum word length that mysql can index to. It was 4 letters by default on my machine.</p>
<p>To change the value to desired one you need to:</p>
<ol>
<li> set <strong> ft_min_word_len</strong> variable up in my.ini file</li>
<li>restart mysql</li>
<li>ensure that the change was applied:<br />
<blockquote><p>SHOW VARIABLES LIKE &#8216;ft_min_word_len&#8217;</p></blockquote>
</li>
<li>rebuild table indices:<br />
<blockquote><p>ALTER TABLE Abc DROP INDEX `word_ind`, ADD FULLTEXT INDEX `word_ind`(`word`);</p></blockquote>
</li>
</ol>
<p>Detailed instructions could be found here &#8211;  http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexzender.com/2008/02/12/full-text-search-in-mysql-and-the-minimum-indexed-word-length/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
