
Why is My Query Faster on the Second Run?
Dear SQL DBA
Query Rerights - Can I Simplify Optimization?
When you first run query after creating a view, sequal server has to compile a plan. If i am using views, are those views introducing complexity that i don't actually need in my query if i were to write it without the views? Sometimes query rerights aren't an option, depending on your application, right? But whenever you can, it's worth looking at. I would also, as a last resort, look at something like using hints in my query. Some folks do. I think hintser ok but i tend to do them last because a hint is really a directive. In sequel server, you are simplifying optimization using them by taking away choices from the automizer.
00:00
Transcript
Play full episode
Remember Everything You Learn from Podcasts
Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.