August 24, 2022 at 11:43 pm
Explain what are the differences between the following execution plans and which of them would you select as the best?
August 25, 2022 at 2:26 am
The Seek is probably a Seek followed by a range scan of the full table, which probably has little if any advantage over the scan. I only use the Execution plan to help me see what is going on. I never make a final choice based on the execution plan. The key would be to run the against your choice of tools... SET STATISTICS TIME,IO ON or SQL Profiler or Extended Events and see which one is the actual winner.
And I never go by % of batch. I can intentionally write a query where the 0% of two batches is actually a whole lot worse than the 100% batch, which can run almost instantaneously while the 0% toting batch takes a minute to run.
And the only way to truly understand the differences between those execution plans would be to dive into the properties of each block but we can't do that because you posted a graphic rather that attaching and actual viable execution plan. Sure, someone could explain a bit like I did above, but you never know for sure until you view the properties of the nodes.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 25, 2022 at 5:48 am
Performance has a cost.
That cost starts with declaring the correct data type for columns !
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
August 25, 2022 at 6:41 am
LEFT is also non-sargable so you will get a scan with that second query.
To make it sargable you would need to use LIKE instead. Thanks
August 25, 2022 at 7:17 am
LEFT is also non-sargable so you will get a scan with that second query.
To make it sargable you would need to use LIKE instead. Thanks
"Like" does not work with numeric data typed columns.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
August 25, 2022 at 8:34 am
Ant-Green wrote:LEFT is also non-sargable so you will get a scan with that second query.
To make it sargable you would need to use LIKE instead. Thanks
"Like" does not work with numeric data typed columns.
doh
will reminded me to ensure I drink a full coffee and read the full query before posting early morning.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply