﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / Odd performance caused by Where Clause / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 00:34:42 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Odd performance caused by Where Clause</title><link>http://www.sqlservercentral.com/Forums/Topic1419811-338-1.aspx</link><description>[quote][b]JblakTSql (2/14/2013)[/b][hr]no, I am not able to create indexes for this data. It has duplicates in it.[/quote]Yes you are. Indexes do not have to contain unique values.</description><pubDate>Fri, 15 Feb 2013 01:16:57 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>RE: Odd performance caused by Where Clause</title><link>http://www.sqlservercentral.com/Forums/Topic1419811-338-1.aspx</link><description>[quote][b]opc.three (2/14/2013)[/b][hr][quote]Any idea why this would happen or how to troubleshoot this?[/quote]No way to tell from here. Please post the Actual Execution Plans for all three queries.[/quote]I'll pull that and post it.  Regardless, i was trying to understand why this would happen.  I can tell you that the execution plan for the filter that works looks the same as the filter that doesn't work.  The difference is in cost for the filter and nested loops</description><pubDate>Thu, 14 Feb 2013 22:04:02 GMT</pubDate><dc:creator>JblakTSql</dc:creator></item><item><title>RE: Odd performance caused by Where Clause</title><link>http://www.sqlservercentral.com/Forums/Topic1419811-338-1.aspx</link><description>no, I am not able to create indexes for this data. It has duplicates in it.</description><pubDate>Thu, 14 Feb 2013 22:01:10 GMT</pubDate><dc:creator>JblakTSql</dc:creator></item><item><title>RE: Odd performance caused by Where Clause</title><link>http://www.sqlservercentral.com/Forums/Topic1419811-338-1.aspx</link><description>[quote]Any idea why this would happen or how to troubleshoot this?[/quote]No way to tell from here. Please post the Actual Execution Plans for all three queries.</description><pubDate>Thu, 14 Feb 2013 15:35:23 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: Odd performance caused by Where Clause</title><link>http://www.sqlservercentral.com/Forums/Topic1419811-338-1.aspx</link><description>Do you have an index on the 'server' column?</description><pubDate>Thu, 14 Feb 2013 09:55:01 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>RE: Odd performance caused by Where Clause</title><link>http://www.sqlservercentral.com/Forums/Topic1419811-338-1.aspx</link><description>[quote][b]JblakTSql (2/13/2013)[/b][hr]So I have this odd issue that I can't figure out how to solve.  I have a poorly written view which runs slowly but works (returns data in ~ 8 sec).   Select * from view1 returns:Action     Name     Serveradd        item1      server1add        item2      server1update    item3      server2 I know i am violating a common rule but have a good reason where I am nesting this view inside of another view which filters the results to an action. In this case my view is called view2 with code Select * from view1 where action = 'update'.  This runs in ~ 7 secs.Now here is the problem.  When I run the following:  Select * From View2, it returns data in roughly ~7 sec.  When I run Select * from View2 Where Server = 'Server2', returns data in roughly ~ 7sec, but when I run Select * from View2 where Server = 'Server1', this returns no rows (which is correct) but take over 1 min to return.  Any idea why this would happen or how to troubleshoot this?[/quote]It's unlikely that I'll have time to help today, but if you want others to help then it might be a good idea to [url=http://www.sqlservercentral.com/articles/SQLServerCentral/66909/]follow the advise in this link --&amp;gt; http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url].</description><pubDate>Thu, 14 Feb 2013 01:45:17 GMT</pubDate><dc:creator>Cadavre</dc:creator></item><item><title>Odd performance caused by Where Clause</title><link>http://www.sqlservercentral.com/Forums/Topic1419811-338-1.aspx</link><description>So I have this odd issue that I can't figure out how to solve.  I have a poorly written view which runs slowly but works (returns data in ~ 8 sec).   Select * from view1 returns:Action     Name     Serveradd        item1      server1add        item2      server1update    item3      server2 I know i am violating a common rule but have a good reason where I am nesting this view inside of another view which filters the results to an action. In this case my view is called view2 with code Select * from view1 where action = 'update'.  This runs in ~ 7 secs.Now here is the problem.  When I run the following:  Select * From View2, it returns data in roughly ~7 sec.  When I run Select * from View2 Where Server = 'Server2', returns data in roughly ~ 7sec, but when I run Select * from View2 where Server = 'Server1', this returns no rows (which is correct) but take over 1 min to return.  Any idea why this would happen or how to troubleshoot this?</description><pubDate>Wed, 13 Feb 2013 21:47:46 GMT</pubDate><dc:creator>JblakTSql</dc:creator></item></channel></rss>