<?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>Rusty Razor Blade &#187; mssql</title>
	<atom:link href="http://www.rustyrazorblade.com/category/mssql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Fri, 13 Aug 2010 23:33:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL and Materialized Views</title>
		<link>http://www.rustyrazorblade.com/2008/05/mysql-and-materialized-views/</link>
		<comments>http://www.rustyrazorblade.com/2008/05/mysql-and-materialized-views/#comments</comments>
		<pubDate>Tue, 13 May 2008 08:01:25 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[db2]]></category>
		<category><![CDATA[mssql]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=126</guid>
		<description><![CDATA[I was poking around the MySQL Worklog again over the weekend, and found a request for materialized views for MySQL.  This feature has existed in Oracle for a while, in DB2 as a materialized query table, and appeared in MS SQL Server 2000 and 2005 as indexed views.
What is a materialized view?
A materialized view [...]]]></description>
			<content:encoded><![CDATA[<p>I was poking around the MySQL Worklog again over the weekend, and found a <a href="http://forge.mysql.com/worklog/task.php?id=2866">request for materialized views for MySQL</a>.  This feature has existed in <a href="http://download-uk.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_6002.htm#i2063793">Oracle</a> for a while, in <a href="http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/core/c0009318.htm">DB2</a> as a materialized query table, and appeared in <a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx">MS SQL Server 2000 and 2005</a> as indexed views.</p>
<p>What is a materialized view?</p>
<p>A materialized view is a database object that contains the results of a query. The FROM clause of the query can name tables, views, and other materialized views. (from Oracle).</p>
<p>Essentially a materialized view lets you tell the database to periodically refresh a table with the results of a query.  You may join, group, and perform calculations.  The goal is to increase query performance in a read-heavy environment.  </p>
<p>Additionally, at least in the other DBs listed, you can put indexes on the fields within the view.  </p>
<p>Disadvantages:</p>
<ul>
<li>There can be issues with altering underlying tables, just as if you were to remove a column that a standard view references.</li>
<li>If you&#8217;re inserting and updating into the base tables frequently, you will either see a performance hit or have to deal with stale data.</li>
<li>Since the data is actually stored as a table on disk, it can take up considerable space</li>
</ul>
<p>According to the high level architecture</p>
<blockquote><p>Support creation of materialized views, with only the bare  minimum &#8212; no automatic refresh, no query rewrite.
</p></blockquote>
<p>Which would be a shame, because it seems that adding in automatic refresh would be a pretty small part of a very complex feature. I haven&#8217;t dealt with any of the MySQL codebase so this is just my speculation.</p>
<p>Of course, when looking at any feature, it&#8217;s important to determine how useful it actually would be to implement.  What is the target audience, and are they the existing customers?  What&#8217;s the goal of adding this feature?  </p>
<p>For ther reading, <a href="http://www.databasejournal.com/features/mssql/article.php/2119721">Database journal</a> has a very good overview of indexed views in SQL Server. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2008/05/mysql-and-materialized-views/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
