<?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>Ideologics &#187; MySQL</title>
	<atom:link href="http://www.ideologics.co.uk/tags/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ideologics.co.uk</link>
	<description>All About Computers</description>
	<lastBuildDate>Fri, 20 May 2011 04:05:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>(Part 1) PHP &amp; MySQL: How to create a resource system</title>
		<link>http://www.ideologics.co.uk/programming/part-1-php-mysql-how-to-create-a-resource-system</link>
		<comments>http://www.ideologics.co.uk/programming/part-1-php-mysql-how-to-create-a-resource-system#comments</comments>
		<pubDate>Tue, 28 Oct 2008 00:23:56 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.eyeonsilicon.com/?p=41</guid>
		<description><![CDATA[One of the biggest problems faced with content rich websites is how to store the data than enriches them. Therefore, I&#8217;d like to offer my solution &#8211; something I call &#8216;the resource system&#8217;. Specifically, this is designed for PHP &#38; &#8230; <a href="http://www.ideologics.co.uk/programming/part-1-php-mysql-how-to-create-a-resource-system">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the biggest problems faced with content rich websites is how to store the data than enriches them. Therefore, I&#8217;d like to offer my solution &#8211; something I call &#8216;the resource system&#8217;.</p>
<p>Specifically, this is designed for PHP &amp; MySQL, but in theory could be adapted to work with other platforms.</p>
<p>The idea is to take the large part of the data (the content) and place it into a set of tables where it can be managed by a resource system.</p>
<p><span id="more-41"></span></p>
<p>Suppose we have a table called &#8216;posts&#8217;, which stored a unique ID, title, date and content for each row. Now suppose we used this table to store the daily posts from our members. If we had 1000 members who posted daily, it wouldn&#8217;t be long before our table reached a phenomenal size.</p>
<p><!--adsense--></p>
<p>When you query that table for a list of the entries, you&#8217;ll almost never use the content field. Separating the content from the rest of the information allows for quicker alteration of what we&#8217;ll refer to now as the &#8216;log&#8217;.</p>
<p>This calls for a system that can manage content in its bare form &#8211; text. We need to be able to take the content, submit it to a function that returns a resource-ID that we can store in the &#8216;log&#8217;. Then later retrieve that data using the resource-ID.</p>
<p>Making the system structured like this will allow for further optimisation later using a utility called MEMCACHED, but we&#8217;ll leave that for a later post.</p>
<p>There are many advantages to this system, that we&#8217;ll discuss in the next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ideologics.co.uk/programming/part-1-php-mysql-how-to-create-a-resource-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>9 Tips To Speed Up MySQL Tables</title>
		<link>http://www.ideologics.co.uk/programming/mysql-how-to-speed-up-tables-clogged-with-content</link>
		<comments>http://www.ideologics.co.uk/programming/mysql-how-to-speed-up-tables-clogged-with-content#comments</comments>
		<pubDate>Tue, 28 Oct 2008 00:08:06 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.eyeonsilicon.com/?p=39</guid>
		<description><![CDATA[In designing my content enriched website, I quickly discovered that trying to handle large quantities of data is a real bottle neck that can be a pain to overcome. So here&#8217;s a few (unorganised) tips that I think will help: &#8230; <a href="http://www.ideologics.co.uk/programming/mysql-how-to-speed-up-tables-clogged-with-content">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In designing my content enriched website, I quickly discovered that trying to handle large quantities of data is a real bottle neck that can be a pain to overcome.</p>
<p>So here&#8217;s a few (unorganised) tips that I think will help:</p>
<p><span id="more-39"></span></p>
<ol>
<li>Don&#8217;t make a VARCHAR field 255 characters if it&#8217;ll only ever be 32 characters long.<br />
 </li>
<li>Use UNSIGNED where possible (that&#8217;s anywhere you&#8217;re not going to store a negative value).<br />
 </li>
<li>Use the smallest field types possible, if your range doesn&#8217;t exceed 0~255 then TINYINT is your best friend. Applying these basic tactics to all fields will help reduce the size of your table and ultimately reduce the overall workload that MySQL has to deal with.<br />
 </li>
<li>Split large data into other tables. If you have a LONGTEXT in your table, you&#8217;ll find that disk fragmentation causes hefty disk work. To help prevent this you can move the LONGTEXT fields into a table on their own. We&#8217;ll call the first table the &#8216;log&#8217;, and the second table the &#8216;data&#8217;. You store all the basic information in the &#8216;log&#8217; table (such as the title, date and size), and then the content in the &#8216;data&#8217; table.<br />
 </li>
</ol>
<p><!--adsense--></p>
<ol start="5">
<li>In addition to point 4- if you have way too much data, try making multiple &#8216;data&#8217; tables fed by the same &#8216;log&#8217; table, this makes optimization much easier.<br />
 </li>
<li>If you&#8217;re using PHP or something similar, you can usually use sessions to store data that is frequently used rather than requesting it from the database.<br />
 </li>
<li>In addition to point 6 &#8211; if you have many members accessing the same data, sessions just won&#8217;t cut it. But installing and using <a href="http://www.danga.com/memcached/">MEMCACHED</a> might &#8211; it gives you a read/write cache by using some of your spare computer memory.<br />
 </li>
<li>Always make sure you make use of your indexes properly.<br />
 </li>
<li>Never allow indexes that aren&#8217;t used to remain active.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ideologics.co.uk/programming/mysql-how-to-speed-up-tables-clogged-with-content/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

