Nope.
The sad news for you here is that nothing aside from selecting a CTE into a real or temporary table will materialize the result of the query within in it.
WITH cte AS ( SELECT TOP (1) u.Id FROM…
SQL Server Consulting, Education, and Training
The sad news for you here is that nothing aside from selecting a CTE into a real or temporary table will materialize the result of the query within in it.
WITH cte AS ( SELECT TOP (1) u.Id FROM…
There was a three-part series of posts where I talked about a weird performance issue you can hit with parameterized top. While doing some query tuning for a client recently, I ran across a funny scenario where they were …
I love when a demo written for one purpose turns into an even better demo for another purpose.
While working with a client recently, they ran into a performance issue when trying to promote …
To illustrate this problem a little bit better, I need to use a slightly different query.
While a tidy group by was nice to illustrate some of the simpler points about lookups, it overly complicates things when we want …
In the documentation for TOP, the following is listed as a best practice:
…In a SELECT statement, always use an ORDER BY clause with the TOP clause. Because, it’s the only way to predictably indicate which rows are affected
Like most tricks, this has a specific use case, but can be quite effective when you spot it.
I’m going to assume you have a vague understanding of parameter sniffing with stored procedures going into this. If you …
In yesterday’s post, we looked at how row goals affected performance when data matching our join and where clauses didn’t exist.
Today we’re going to look at something similar, and perhaps a workaround to …