Re: Multicolumn correlated subquery?



sql_server_user (kaioptera@xxxxxxxxx) writes:
I reclustered the table and the query is of course much faster now. I
need to keep both versions of the table around for a while to see how
they compare for all the queries we run, so I have an insert trigger
keeping them in sync.

Good to hear that it worked out.

I tried the other permutations of the query you suggested, Erland, and
they had no effect on the execution plan or performance.

Good! This indicates that the query might be stable. :-) I've experienced
situations where such "meaningless" permuation affected the query plan,
so I wanted you to try all three.

--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: query performance help needed
    ... Whether the execution plan is there or not has little do with it. ... It's very clear that you need to analyse your query plans, ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Different query plans for view and view definition statement
    ... values it gives for the view the good query plan using index for ... set statistics profile off ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Database Engine Tuning Advisor suggestion to replace syntax.
    ... What you said was what I first planned to say, but then I read the Books Online which implies that the batch is indeed reused, so I held back from saying that. ... the query optimizer will probably match the Transact-SQL statement in the second execution with the execution plan generated for the first execution. ... SQL Server does not have to compile the second statement." ...
    (microsoft.public.sqlserver.tools)
  • Re: sql 2000 - slow response times after creating a new database
    ... SQL server does not create indexes automatically. ... Statistics are involved with choosing the query plan and such decisions may ... Books Online for more info about the ITW. ... >>>usual system databases. ...
    (microsoft.public.sqlserver.dts)
  • Re: sql 2000 - slow response times after creating a new database
    ... SQL server does not create indexes automatically. ... Statistics are involved with choosing the query plan and such decisions may ... Books Online for more info about the ITW. ... >>>usual system databases. ...
    (microsoft.public.sqlserver.server)