<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; 2008 Star Join Query Optimization</title>
	<atom:link href="http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Nags</title>
		<link>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/#comment-423697</link>
		<dc:creator><![CDATA[Nags]]></dc:creator>
		<pubDate>Tue, 19 Feb 2013 04:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7470#comment-423697</guid>
		<description><![CDATA[Hi Pinal,
Thanks for such a great article, 

I have a small doubt in this, as per the star join startagy it will create hash tables. If our fact table is very huge and our temp DB can&#039;t take up this amount of data into hash table how does it manage the query.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
Thanks for such a great article, </p>
<p>I have a small doubt in this, as per the star join startagy it will create hash tables. If our fact table is very huge and our temp DB can&#8217;t take up this amount of data into hash table how does it manage the query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #006 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/#comment-389243</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #006 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 08 Dec 2012 01:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7470#comment-389243</guid>
		<description><![CDATA[[...] Star Join Query Optimization At present, when queries are sent to very large databases, millions of rows are returned. Also the users have to go through extended query response times when joining multiple tables are involved with such queries. ‘Star Join Query Optimization’ is a new feature of SQL Server 2008 Enterprise Edition. This mechanism uses bitmap filtering for improving the performance of some types of queries by the effective retrieval of rows from fact tables. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Star Join Query Optimization At present, when queries are sent to very large databases, millions of rows are returned. Also the users have to go through extended query response times when joining multiple tables are involved with such queries. ‘Star Join Query Optimization’ is a new feature of SQL Server 2008 Enterprise Edition. This mechanism uses bitmap filtering for improving the performance of some types of queries by the effective retrieval of rows from fact tables. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tirthankar Dutta</title>
		<link>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/#comment-239205</link>
		<dc:creator><![CDATA[Tirthankar Dutta]]></dc:creator>
		<pubDate>Tue, 17 Jan 2012 08:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7470#comment-239205</guid>
		<description><![CDATA[Please optimize it
****************************
SET statistics io ON; 
SET statistics TIME ON; 

SELECT itm.userreviewid            AS itemid, 
       itm.reviewitem              AS title, 
       itm.imgpath                 AS imgpath, 
       &#039;Barkspider&#039;                AS [Source], 
       reviews.numratings, 
       reviews.avgrating, 
       5                           AS ratingmax, 
       &#039;&#039;                          AS itempath, 
       &#039;&#039;                          AS identifier, 
       &#039;barspider-user-review.png&#039; AS logo, 
       Isnull(0, 0)                AS fromprice, 
       Isnull(0, 0)                AS toprice, 
       reviews.totrating, 
       Newid()                     AS &#039;NewID&#039;, 
       &#039;a&#039;                         AS bssort 
FROM   barkspiderblog.dbo.userreviews itm WITH (nolock) 
       JOIN (SELECT COUNT(1)    AS numratings, 
                    AVG(rating) AS avgrating, 
                    SUM(rating) AS totrating, 
                    reviewitem 
             FROM   barkspiderblog.dbo.userreviews WITH (nolock) 
             GROUP  BY reviewitem) reviews 
         ON Lower(itm.reviewitem) = Lower(reviews.reviewitem) 
WHERE  ( ( ( itm.reviewitemid IS NULL 
              OR itm.reviewitemid = 0 ) 
           AND itm.parentid IS NOT NULL ) 
          OR ( itm.reviewitemid IS NOT NULL 
               AND itm.reviewitemid = itm.userreviewid ) ) 
       AND itm.reviewitem LIKE &#039;%tv%&#039; 
       AND itm.userreviewid IN (SELECT userreviewid 
                                FROM   (SELECT Rank() OVER (PARTITION BY 
                                               reviewitem 
                                               ORDER 
                                               BY createdon ASC) AS 
                                               r1, 
                                               userreviewid 
                                        FROM   barkspiderblog.dbo.userreviews 
                                        WHERE  reviewitem LIKE &#039;%tv%&#039;) tab 
                                WHERE  tab.r1 = 1) 
UNION ALL 
SELECT itm.itemid, 
       itm.title, 
       itm.imgpath, 
       src.DESCRIPTION AS [Source], 
       reviews.numratings, 
       reviews.avgrating, 
       src.ratingmax, 
       itm.itempath, 
       itm.identifier, 
       src.logo, 
       fpr.fromprice, 
       fpr.toprice, 
       reviews.totrating, 
       Newid()         AS &#039;NewID&#039;, 
       &#039;b&#039;             AS bssort 
FROM   items itm WITH (nolock) 
       JOIN sources src WITH (nolock) 
         ON itm.sourceid = src.sourceid 
       JOIN (SELECT COUNT(1)    AS numratings, 
                    AVG(rating) AS avgrating, 
                    SUM(rating) AS totrating, 
                    itemid 
             FROM   reviews WITH (nolock) 
             GROUP  BY itemid) reviews 
         ON itm.itemid = reviews.itemid 
       LEFT OUTER JOIN fetchitemprice fpr WITH (nolock) 
         ON itm.itemid = fpr.itemid 
WHERE  title LIKE &#039;%tv%&#039; 
UNION ALL 
SELECT itm.itemid, 
       itm.title, 
       itm.imgpath, 
       &#039;Barkspider&#039;                AS [Source], 
       reviews.numratings, 
       reviews.avgrating, 
       5                           AS ratingmax, 
       itm.itempath, 
       itm. identifier, 
       &#039;barspider-user-review.png&#039; AS logo, 
       0                           AS fromprice, 
       0                           AS toprice, 
       reviews.totrating, 
       Newid()                     AS newid, 
       &#039;a&#039;                         AS bssort 
FROM   items itm WITH (nolock) 
       JOIN sources src WITH (nolock) 
         ON itm.sourceid = src.sourceid 
       JOIN (SELECT COUNT(1)    AS numratings, 
                    AVG(rating) AS avgrating, 
                    SUM(rating) AS totrating, 
                    reviewitemid, 
                    reviewitem 
             FROM   barkspiderblog.dbo.userreviews WITH (nolock) 
             GROUP  BY reviewitem, 
                       reviewitemid) reviews 
         ON itm.itemid = reviews.reviewitemid 
       LEFT OUTER JOIN fetchitemprice fpr WITH (nolock) 
         ON itm.itemid = fpr.itemid 
WHERE  itm.itemid IN (SELECT ur1.reviewitemid 
                      FROM   barkspiderblog.dbo.userreviews ur1 WITH (nolock) 
                      WHERE  ur1.parentid IS NULL) 
       AND title LIKE &#039;%tv%&#039; 
ORDER  BY bssort, 
          Newid()]]></description>
		<content:encoded><![CDATA[<p>Please optimize it<br />
****************************<br />
SET statistics io ON;<br />
SET statistics TIME ON; </p>
<p>SELECT itm.userreviewid            AS itemid,<br />
       itm.reviewitem              AS title,<br />
       itm.imgpath                 AS imgpath,<br />
       &#8216;Barkspider&#8217;                AS [Source],<br />
       reviews.numratings,<br />
       reviews.avgrating,<br />
       5                           AS ratingmax,<br />
       &#8221;                          AS itempath,<br />
       &#8221;                          AS identifier,<br />
       &#8216;barspider-user-review.png&#8217; AS logo,<br />
       Isnull(0, 0)                AS fromprice,<br />
       Isnull(0, 0)                AS toprice,<br />
       reviews.totrating,<br />
       Newid()                     AS &#8216;NewID&#8217;,<br />
       &#8216;a&#8217;                         AS bssort<br />
FROM   barkspiderblog.dbo.userreviews itm WITH (nolock)<br />
       JOIN (SELECT COUNT(1)    AS numratings,<br />
                    AVG(rating) AS avgrating,<br />
                    SUM(rating) AS totrating,<br />
                    reviewitem<br />
             FROM   barkspiderblog.dbo.userreviews WITH (nolock)<br />
             GROUP  BY reviewitem) reviews<br />
         ON Lower(itm.reviewitem) = Lower(reviews.reviewitem)<br />
WHERE  ( ( ( itm.reviewitemid IS NULL<br />
              OR itm.reviewitemid = 0 )<br />
           AND itm.parentid IS NOT NULL )<br />
          OR ( itm.reviewitemid IS NOT NULL<br />
               AND itm.reviewitemid = itm.userreviewid ) )<br />
       AND itm.reviewitem LIKE &#8216;%tv%&#8217;<br />
       AND itm.userreviewid IN (SELECT userreviewid<br />
                                FROM   (SELECT Rank() OVER (PARTITION BY<br />
                                               reviewitem<br />
                                               ORDER<br />
                                               BY createdon ASC) AS<br />
                                               r1,<br />
                                               userreviewid<br />
                                        FROM   barkspiderblog.dbo.userreviews<br />
                                        WHERE  reviewitem LIKE &#8216;%tv%&#8217;) tab<br />
                                WHERE  tab.r1 = 1)<br />
UNION ALL<br />
SELECT itm.itemid,<br />
       itm.title,<br />
       itm.imgpath,<br />
       src.DESCRIPTION AS [Source],<br />
       reviews.numratings,<br />
       reviews.avgrating,<br />
       src.ratingmax,<br />
       itm.itempath,<br />
       itm.identifier,<br />
       src.logo,<br />
       fpr.fromprice,<br />
       fpr.toprice,<br />
       reviews.totrating,<br />
       Newid()         AS &#8216;NewID&#8217;,<br />
       &#8216;b&#8217;             AS bssort<br />
FROM   items itm WITH (nolock)<br />
       JOIN sources src WITH (nolock)<br />
         ON itm.sourceid = src.sourceid<br />
       JOIN (SELECT COUNT(1)    AS numratings,<br />
                    AVG(rating) AS avgrating,<br />
                    SUM(rating) AS totrating,<br />
                    itemid<br />
             FROM   reviews WITH (nolock)<br />
             GROUP  BY itemid) reviews<br />
         ON itm.itemid = reviews.itemid<br />
       LEFT OUTER JOIN fetchitemprice fpr WITH (nolock)<br />
         ON itm.itemid = fpr.itemid<br />
WHERE  title LIKE &#8216;%tv%&#8217;<br />
UNION ALL<br />
SELECT itm.itemid,<br />
       itm.title,<br />
       itm.imgpath,<br />
       &#8216;Barkspider&#8217;                AS [Source],<br />
       reviews.numratings,<br />
       reviews.avgrating,<br />
       5                           AS ratingmax,<br />
       itm.itempath,<br />
       itm. identifier,<br />
       &#8216;barspider-user-review.png&#8217; AS logo,<br />
       0                           AS fromprice,<br />
       0                           AS toprice,<br />
       reviews.totrating,<br />
       Newid()                     AS newid,<br />
       &#8216;a&#8217;                         AS bssort<br />
FROM   items itm WITH (nolock)<br />
       JOIN sources src WITH (nolock)<br />
         ON itm.sourceid = src.sourceid<br />
       JOIN (SELECT COUNT(1)    AS numratings,<br />
                    AVG(rating) AS avgrating,<br />
                    SUM(rating) AS totrating,<br />
                    reviewitemid,<br />
                    reviewitem<br />
             FROM   barkspiderblog.dbo.userreviews WITH (nolock)<br />
             GROUP  BY reviewitem,<br />
                       reviewitemid) reviews<br />
         ON itm.itemid = reviews.reviewitemid<br />
       LEFT OUTER JOIN fetchitemprice fpr WITH (nolock)<br />
         ON itm.itemid = fpr.itemid<br />
WHERE  itm.itemid IN (SELECT ur1.reviewitemid<br />
                      FROM   barkspiderblog.dbo.userreviews ur1 WITH (nolock)<br />
                      WHERE  ur1.parentid IS NULL)<br />
       AND title LIKE &#8216;%tv%&#8217;<br />
ORDER  BY bssort,<br />
          Newid()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Crawford</title>
		<link>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/#comment-120592</link>
		<dc:creator><![CDATA[Matthew Crawford]]></dc:creator>
		<pubDate>Thu, 24 Feb 2011 22:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7470#comment-120592</guid>
		<description><![CDATA[Thank you for this informative article, I had not read about this before but this will make a strong case for using a star schema when it fits the DB utilization.]]></description>
		<content:encoded><![CDATA[<p>Thank you for this informative article, I had not read about this before but this will make a strong case for using a star schema when it fits the DB utilization.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
