| | |
Get records from current year
Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Sep 2009
Posts: 42
Reputation:
Solved Threads: 5
0
#12 Nov 6th, 2009
This might be true on SQL 2005. I compared execution plans and the cost was 50/50 using functions and constants. There was no discernable difference in retrieval speeds, but I wasn't using a large table to do so.
What I do know is a user had defined a hash function and was using it on the other side from the column. It was taking 13 seconds to retrieve the data that matched the hash. Changed the routine to use a constant varchar variable and the response time went to 25 milliseconds. I also know I read a book that says the function is executed against every row in a table and shouldn't be used when the result is a constant value.
Of course the book and I can be out of date now.
What I do know is a user had defined a hash function and was using it on the other side from the column. It was taking 13 seconds to retrieve the data that matched the hash. Changed the routine to use a constant varchar variable and the response time went to 25 milliseconds. I also know I read a book that says the function is executed against every row in a table and shouldn't be used when the result is a constant value.
Of course the book and I can be out of date now.
![]() |
Similar Threads
- returing the current year (Java)
- displaying current year in textbox (VB.NET)
- Current month name (ASP.NET)
- Validate the input date by comparing it with current year using Date function Date(Y) (PHP)
- Logic to Convert Days From 1800 to a Date (Month, Day, Year) (C++)
- Giving records in MS Access unique numbers (MS Access and FileMaker Pro)
Other Threads in the MS SQL Forum
- Previous Thread: How to Create database in SQL Server using Javascript & HTML?
- Next Thread: LEFT JOIN problem
Views: 942 | Replies: 11
| Thread Tools | Search this Thread |
Tag cloud for MS SQL
"last autogrowth business connectingtodatabaseinuse count cursor data database dateadd datepart day" dbsize deadlock delete_trigger exploit getdate hack highperformancecomputing hpc hpcserver2008 ibm iis limit loop maximum microsoft ms mssql multiple multithreading news number password permission position query reporting result security server services sets single source sql sql-injection sqlserver sqlserver2005 subtype supercomputing supertype tables uniqueid update view weekday





