[Video] Office Hours: Overheating Cadillac Edition
I took your questions from https://pollgab.com/room/brento before heading out to pick up my Cadillac from the mechanic.
https://youtu.be/B02i8Ldgy_4
How SQL Server compiles, optimizes, and executes individual queries.
573 associated posts292 primary posts
I took your questions from https://pollgab.com/room/brento before heading out to pick up my Cadillac from the mechanic.
https://youtu.be/B02i8Ldgy_4
Post your SQL Server and Azure SQL DB questions at https://pollgab.com/room/brento and upvote the ones you'd like to hear me discuss.
https://youtu.be/hZSavloVmuw
Thankfully, we didn't hit any icebergs or glacier droppings, so I put my comfiest coat on to answer your top-voted questions from https://pollgab.com/room/brento.
https://www.youtube.com/watch?v=ZIUbZvtPsrc
Y'all post questions at https://pollgab.com/room/brento, and I go through the top-voted ones on my Twitch channel streams.
https://www.youtube.com/watch?v=TpNXUCPzfj4
A lot of today's questions from https://pollgab.com/room/brento have a common theme, but it's just a coincidence:
https://www.youtube.com/watch?v=x2Tm_BHXT68
This one's broken up into two parts because I took a bio break mid-stream:
https://www.youtube.com/watch?v=ZhFG3LllLug
HONK HONK! It's time for a fast round of answers to concise questions y'all posted and upvoted at https://pollgab.com/room/brento.
https://youtu.be/DhTqXJ1fTBw
Some of the questions y'all post at https://pollgab.com/room/brento have easy one-line answers. Let's knock 'em out:
George: Hi Brent, what recently has been the most challenging/surprising/new-to-you performance issue you have encountered?
Before heading out to Old Town for sightseeing, I went through your top-voted questions from https://pollgab.com/room/brento.
https://www.youtube.com/watch?v=5x1SwTkBpFk
I'm on a boat! I'm on a 10-day Panama Canal cruise, and I stopped (well, not the boat) off the coast of Florida to answer questions y'all posted at https://pollgab.com/room/brento.
https://www.youtube.com/watch?v=XLxaHT5tdUU
Not all of the questions y'all post at https://pollgab.com/room/brento require long-winded responses.
Brandon: Do you seen a rise in json queries to address impedance mismatch between data/objects? I struggled with EF to produce a query that was neither simple nor complicated against a properly designed db (according to 2 experts). Dropped EF; used json query in stored proc; it was magic.
While waiting for the dry cleaner to open, I went live to stream a quiet session going through a bunch of y'all's questions from https://pollgab.com/room/brento.
https://youtu.be/1rYG0laQpOU
We went up to Michigan to see my dad's side of the family, and the snow came down just in time for our arrival. Always love the fresh snow look.
So I stood outside and took your top-voted questions from https://pollgab.com/room/brento. Let's see what y'all came up with today:
Lots of good questions on today's broadcast! If you'd like to submit one, go to https://pollgab.com/room/brento and upvote the ones you'd like to see me cover.
https://youtu.be/phAwmrItoCY
If you've been following along with this week's posts on DATETRUNC and STRING_SPLIT, you're probably going to think the answer is no, but bear with me. It's Christmas week, right? The news can't all be bad.
GREATEST and LEAST are kinda like MAX and MIN, but instead of taking multiple rows as input, they take multiple columns. For example:
[crayon-6a737da3c4c28029720702/]
Produces 3 and 1. This actually has really useful real-world implications.
SQL Server 2022 improved the STRING_SPLIT function so that it can now return lists that are guaranteed to be in order. However, that's the only thing they improved - there's still a critical performance problem with it. Let's take the Stack Overflow database, Users table, put in an index on Location, and then test a…
SQL Server 2022 introduced a new T-SQL element, DATETRUNC, that truncates parts of dates. For example:
[crayon-6a737da3c62db478044168/]
Truncates everything in that date other than the year, so it returns just 2017-01-01 00:00:
You might ask, "Well, why not just use YEAR()?" That's a good question - there are times when you need a start or end date for a date range, and this could make it easier than trying to construct a full start & end date yourself.
I was helping a client with a query, and I'm going to rework the example to use the Stack Overflow database for easier storytelling.
Say we need to:
My Black Friday sale is in its last days, so most of my time at the moment is spent keeping an eye on the site and answering customer questions. I'm happy to say it's our best year so far, too! Y'all really like the new access-for-life options.
I took a break from the online frenzy to check in on the questions you posted at https://pollgab.com/room/brento and answer the highest-voted ones:
This week, a lot of the questions you posted at https://pollgab.com/room/brento just need pointers to resources at other places. Welcome to the Read This, Watch This series of answers.
Don't Blame Anthony: Our developers prefer writing TSQL queries directly in their .NET code rather than writing sprocs and calling them. What are the pros / cons to this approach?