May 10, 2019 at 12:55 pm
Is there any way to calculate the hash for the query which will the same as calculated by the engine?
May 10, 2019 at 1:30 pm
Which hash are you referring to?
Which tool are you wanting to calculate the hash with?
Which engine are you referring to? The Mazda I have at the moment is pretty fast, but its engine is rubbish with hashes.
If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.
May 10, 2019 at 1:41 pm
I don't think you can because the hash is created internally based on a structure in the optimizer, not the T-SQL text, that would also have to be recreated. You could probably run the debugger to figure all this out. What do you need it for?
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
May 10, 2019 at 1:48 pm
I don't think you can because the hash is created internally based on a structure in the optimizer, not the T-SQL text, that would also have to be recreated. You could probably run the debugger to figure all this out. What do you need it for?
Ah, that hash. I was thinking that the OP was referring to something like HASHBYTES or CHECKSUM.
If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.
May 10, 2019 at 2:58 pm
Really curious what the use case and need is though.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
May 10, 2019 at 3:36 pm
Grant,
I have EF Core interceptor created for my app. I want to calculate such hash value for the query being executeted. Next I want to match this hash to the hash stored in DMV views.
May 10, 2019 at 3:55 pm
Ah, interesting use of the tools. Unfortunately, I don't know of a way to do it. I'm not saying it can't be done, just that there's not a way I'm aware of.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
May 10, 2019 at 4:55 pm
Thank you Grant for your reply.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply