August 21, 2012 at 5:38 am
Sergiy (8/20/2012)
CELKO (8/19/2012)
2. CONVERT() is an expensive string formatting function, with all those old Sybase options; substring and concatenation are cheap, simple and fast.....
Turns out, SUBSTRING with concatenations is not that fast. It's the slowest option, after all.
And CONVERT is faster than CAST. Only marginally, but still.
It may be because of that:
set showplan_all on
go
select CAST('20120101' as DATE)
from dbo.MyTable
Check what is the physical operation for the CAST really is in MS SQL Server...
Mr.Celko, you will be surprised, it is:
|--Compute Scalar(DEFINE:([Expr1003]=CONVERT(date,[@1],0)))
Oops...
:w00t:
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply