Re: Not passing back values on an if statement
From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 02/21/05
- Next message: David Gugick: "Re: Schedule design issue"
- Previous message: Mike W: "Re: isnumeric()"
- In reply to: Hugo Kornelis: "Re: Not passing back values on an if statement"
- Next in thread: Alejandro Mesa: "Re: Not passing back values on an if statement"
- Reply: Alejandro Mesa: "Re: Not passing back values on an if statement"
- Reply: Hugo Kornelis: "Re: Not passing back values on an if statement"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Feb 2005 16:21:09 -0500
Hugo Kornelis wrote:
> On Mon, 21 Feb 2005 09:37:16 -0800, tshad wrote:
>
> (snip)
>> BTW, why would "select *" give you a better response than "select
>> Application"?
>
> Hi Tom,
>
> With SELECT *, SQL Server only has to check for the existance of a
> row. This can be done with any index, without the need to access the
> real data.
>
> With SELECT Application, SQL Server has to check not only that a row
> exists, but also that the Application in that row is not NULL. If the
> column Application doesn't allow NULLs, performance will be the same.
> But if this column does allow NULLs, SQL Server will have to fetch
> the data to check for NULL. This might require extra access to the
> data, or restrict the choice if indices to use for the query.
>
> Best, Hugo
OK, the last time I suggested there may be adifference between using "SELECT
* ..." and "SELECT column ..." in an EXISTS subquery, I was called on it by
several people. So I will pose to you the same question that was posed to
me: Can you provide a repro script that illustrates a difference in
execution plan or performance when using * as opposed to a column name in an
EXISTS subquery? :-)
Bob Barrows
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
- Next message: David Gugick: "Re: Schedule design issue"
- Previous message: Mike W: "Re: isnumeric()"
- In reply to: Hugo Kornelis: "Re: Not passing back values on an if statement"
- Next in thread: Alejandro Mesa: "Re: Not passing back values on an if statement"
- Reply: Alejandro Mesa: "Re: Not passing back values on an if statement"
- Reply: Hugo Kornelis: "Re: Not passing back values on an if statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|