<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Precomputed view: A cool and useful SQL pattern</title>
	<atom:link href="http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/feed/" rel="self" type="application/rss+xml" />
	<link>http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/</link>
	<description>On programming, technology, and random things of interest</description>
	<lastBuildDate>Thu, 29 Jul 2010 00:28:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Yang</title>
		<link>http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/comment-page-1/#comment-666</link>
		<dc:creator>Yang</dc:creator>
		<pubDate>Tue, 02 Feb 2010 16:55:21 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/#comment-666</guid>
		<description>Would you mind juxtaposing precomputed views with materialized views?</description>
		<content:encoded><![CDATA[<p>Would you mind juxtaposing precomputed views with materialized views?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: youblogmylife</title>
		<link>http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/comment-page-1/#comment-520</link>
		<dc:creator>youblogmylife</dc:creator>
		<pubDate>Tue, 28 Apr 2009 04:41:48 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/#comment-520</guid>
		<description>Thanks for all the feedback. Love your site.</description>
		<content:encoded><![CDATA[<p>Thanks for all the feedback. Love your site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergeyr</title>
		<link>http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/comment-page-1/#comment-519</link>
		<dc:creator>Sergeyr</dc:creator>
		<pubDate>Mon, 20 Apr 2009 22:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/#comment-519</guid>
		<description>Also consider SQL server clustered views</description>
		<content:encoded><![CDATA[<p>Also consider SQL server clustered views</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor Ostrovsky</title>
		<link>http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/comment-page-1/#comment-518</link>
		<dc:creator>Igor Ostrovsky</dc:creator>
		<pubDate>Tue, 14 Apr 2009 20:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/#comment-518</guid>
		<description>Barry &amp; Martin: I didn&#039;t know about the indexed view feature. Very cool! I&#039;ll definitely experiment with it the next time I am solving this kind of a problem, which is bound to be soon. :-)

Barry: Thanks for letting me know about the formatting issue. For a couple minutes, the article was posted badly formatted, and Google Reader must have crawled and cached it at that time.</description>
		<content:encoded><![CDATA[<p>Barry &#038; Martin: I didn&#8217;t know about the indexed view feature. Very cool! I&#8217;ll definitely experiment with it the next time I am solving this kind of a problem, which is bound to be soon. <img src='http://igoro.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Barry: Thanks for letting me know about the formatting issue. For a couple minutes, the article was posted badly formatted, and Google Reader must have crawled and cached it at that time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/comment-page-1/#comment-517</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Tue, 14 Apr 2009 17:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/#comment-517</guid>
		<description>Hi Igor,

nice approach. Have You considered indexing the Article_View resp. User_View?
As the only thing needed is an aggregate over the votes (ArticleVote resp. Karma) I would suggest creating an index on both views. That way one places the burden of updating the aggregate column totally to the indexing engine. 

Additional benefit comes from the fact, that SQL server is able to infer the index on the view, even when the view itself is not refrenced in the FROM clause. So even when querying like 
SELECT 
    Sum(v.Vote) as Sum_Votes, v.ArticleID 
FROM Vote  v 
GROUP BY v.ArticleID

the query analyzer is able to infer the index on the Article_View! So even existing queries benefit from the index.

Martin</description>
		<content:encoded><![CDATA[<p>Hi Igor,</p>
<p>nice approach. Have You considered indexing the Article_View resp. User_View?<br />
As the only thing needed is an aggregate over the votes (ArticleVote resp. Karma) I would suggest creating an index on both views. That way one places the burden of updating the aggregate column totally to the indexing engine. </p>
<p>Additional benefit comes from the fact, that SQL server is able to infer the index on the view, even when the view itself is not refrenced in the FROM clause. So even when querying like<br />
SELECT<br />
    Sum(v.Vote) as Sum_Votes, v.ArticleID<br />
FROM Vote  v<br />
GROUP BY v.ArticleID</p>
<p>the query analyzer is able to infer the index on the Article_View! So even existing queries benefit from the index.</p>
<p>Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barry Dahlberg</title>
		<link>http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/comment-page-1/#comment-516</link>
		<dc:creator>Barry Dahlberg</dc:creator>
		<pubDate>Tue, 14 Apr 2009 10:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://igoro.com/archive/precomputed-view-a-cool-and-useful-sql-pattern/#comment-516</guid>
		<description>FYI Google Reader murdered your HTML and presented a big blog of black text with no formatting.

I&#039;ve used this technique before with good success.  Microsofts SQL Server also has the ability to create &quot;indexed views&quot; which are roughly equivalent and a good option if your view logic is a simple select query.</description>
		<content:encoded><![CDATA[<p>FYI Google Reader murdered your HTML and presented a big blog of black text with no formatting.</p>
<p>I&#8217;ve used this technique before with good success.  Microsofts SQL Server also has the ability to create &#8220;indexed views&#8221; which are roughly equivalent and a good option if your view logic is a simple select query.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
