28,734 reputation
771121
bio website
location United Kingdom
age
visits member for 3 years, 1 month
seen 12 hours ago

Email: stackoverflowmartinsmith@gmail.com


Nov
22
comment Quirk update for cumulative sum of chances for a raffle. What can go wrong?
Agree with @usr. This question as it stands is unlikely to get an answer that does any more than copy Jeff's extremely time consumingly researched conclusions. You're better off posting your table structure, exact requirements, and asking how the requirements can be achieved efficiently.
Nov
22
comment Quirk update for cumulative sum of chances for a raffle. What can go wrong?
Have you read the Jeff Moden article on SQL Server Central where he lists the "rules"? Certainly I have seen this fail in the wild when the query got a parallel plan.
Nov
22
comment Query execute slowly when changed compatibility Level of my database
Maybe you are getting a worse plan because of the new cardinality estimator. What do the plans look like? Does trace flag 9481 help?
Nov
21
comment 01/01/1753 date is corrupt in Excel after export from SSRS
Do you have a legitimate reason for using that date anyway? Or is it some sort of sentinel value that should be NULL?
Nov
21
comment Duplicate Key Entry
Please upload the execution plan or provide code that reproduces the issue.
Nov
21
comment Using sp_BlitzIndex - Diagnosed as “Index Hoarder: Addicted to nulls”
@MatthewClemente Allowing columns to be null-able even though you know they do not need to allow them removes a level of self documentation and means other users of your database will end up having to write unnecessarily complex queries to handle the possibility of null. E.g in equality comparisons, or not in, or string concatenation, or addition.
Nov
16
comment Performance Order By large table with Join
How many rows match the condition if you remove the TOP 50? With the TOP 50 in place what is the actual vs estimated number of executions of the clustered index seek?
Nov
16
comment Performance Order By large table with Join
How many rows in both tables?
Nov
16
comment Table design for optimum performance
If an employee has gender reassignment surgery will you update their ID?
Nov
16
comment Trigger vs Stored Procedure
Often a stored proc doing the action directly along with the update,delete,insert would be more efficient than doing it in a trigger. The advantage of a trigger is that it fires for all modifications, not just those managed through your procedure.
Nov
14
comment Filter table before join
@Aditi - Not really sure what you are asking. If the small table isn't indexed on the joining column then you can still find the max and min values first, albeit, at greater cost which may make it not worth doing (especially if the range would be large). If the bigger table isn't indexed on the joining column then knowing the min and max values doesn't help as you have no way of efficiently seeking to just that range anyway.
Nov
14
comment SQL Server: performance of IDENTITY vs INT as primary key
Where did you pick up this understanding? Have you looked at the books online topic for ’identity` to see the supported datatypes? Then look at the topic for numeric. Whilst numeric(x,0) is supported this is not stored as a string.
Nov
9
comment Update datatype of primary key without deleting the table-SQL Server
What values does it currently have in it? Are they all things that cast OK to integer? If so do you need the existing values preserved?
Nov
7
comment When a previously-fast SQL query starts running slow, where do I look to find the source of the issue?
At some point in the future the answer might be look in the SQL Server query store
Nov
5
comment Why is cost threshold for parallelism ignored?
It's perfectly possible for the plan to be costed above the threshold for parallelism, go onto the next stage of optimization and then end up with a parallel plan at the end of that stage that is cheaper than the threshold. See for example sqlblog.com/blogs/paul_white/archive/2011/07/07/…
Nov
5
comment Best way to get the most recent insert from a table (SQL Server)
Please add the create table to your question including indexes.
Nov
5
answered about latest row in sql server
Nov
5
comment Filter table before join
It would be interesting to know if any RDBMSs actually do this. Seems like a quite simple optimisation in the event that the joining column is indexed and thus the relevant range can be found cheaply. a similar observation was found here but I couldn't find any discussion on costs and benefits on Connect or academic literature. Seems in the same kind of vein as "sideways information passing" though.
Nov
4
revised Filter table before join
added 7 characters in body
Nov
4
revised Filter table before join
added 113 characters in body