Indexing and Statistics

Designing, evaluating, maintaining, and troubleshooting indexes and statistics.

568 associated posts270 primary posts

Production DBA

Office Hours: Questions That Didn’t Make the Cut

Sometimes, y'all post questions at https://pollgab.com/room/brento and they don't get a lot of upvotes, and reading through 'em, I bet it's because other people don't quite understand what you're asking. I think there might actually be a good question at the heart of it, but ... I'm just not sure what it is, and it needs to be rephrased.

Read more about Office Hours: Questions That Didn’t Make the Cut 18 comments — Join the discussion
Production DBA

Office Hours: Short Text Answers Edition

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.

Read more about Office Hours: Short Text Answers Edition 1 comment — Join the discussion

Should You Use SQL Server 2022’s GREATEST and LEAST?

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-6a6f49e85c98b471992896/]
Produces 3 and 1. This actually has really useful real-world implications.

Read more about Should You Use SQL Server 2022’s GREATEST and LEAST? 2 comments — Join the discussion
T-SQL & Development

Should You Use SQL Server 2022’s STRING_SPLIT?

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…

Read more about Should You Use SQL Server 2022’s STRING_SPLIT? 2 comments — Join the discussion