Daily Coping 8 May 2020

I’ve started to add a daily coping tip to the SQLServerCentral newsletter, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

Set yourself on a kindness mission. Give your time to help others.

I’ve been doing this a few times across the last month. My family hasn’t always been thrilled, but I’ve tried to help others cope by inviting a family over once in awhile. Outside, with them bringing their own refreshments and chairs, but getting the chance to just be outside, have some space, and get away from their routine.

I always appreciate when I can do that, and I’m trying to bring some kindness to others.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 8 May 2020

TSQL for Beginners–#RGCommunityCircle

As a part of the Redgate Community Circle, giving back in this strange time, each of the advocates for Redgate is teaching a free course. We’re doing this live each week, according to this schedule:

I decided to watch a class of each of the others’ work and write about it. This post looks at the first class from Kendra Little on basic T-SQL.

Basic T-SQL

I know a lot of T-SQL, but I also don’t know a lot. I’m good, maybe above average, but not a great query writer. I learn all the time from others, and often find something interesting in basic presentations. I’m also always looking to see how others teach basic topics to improve my own skills.

Kendra has done an interesting thing with putting her course on GitHub. That’s a great idea, though for mine, I am following articles on SQLServerCentral. Having a good outline and resources for students is a good idea, and everyone ought to be able to use a VCS, including GitHub, so I like putting pages here and code in a repo.

Why is that good? This is what I did to start following Kendra’s class:

2020-05-01 10_15_26-cmd

Now I can open the first script in ADS. On top of seeing how Kendra teaches, I get to practice some ADS stuff.

2020-05-01 10_17_28-1_SelectAndAlias_Demo.sql - disconnected - TSQLBeginners - Azure Data Studio

I like the doorstop at the end, and I’ll have to think about that for my demo scripts. I’ve accidentally run the entire script too many times.

Kendra walks through a number of query concepts with a series of basic SELECT statements, including an emoji for a column alias. I’m glad she lets you know which items are not recommended.

The first course is helping you understand some of the ways in which you can get data from tables. You do need to have a slight understanding of what a table is, but Kendra helps you learn some of the strange ways that you can put together a statement. There is a lot to cover, but this should help someone that wants to learn some basics get started.

There is also homework, included as part of the scripts in the course. The questions are at the bottom, and called out. A good way to get you to practice. I should do this for my work in places as well.

2020-05-01 11_09_20-1_SelectAndAlias_Demo.sql - Plato_SQL2017.sandbox (Integrated) - TSQLBeginners -

Pass this course along to someone that needs to get better at T-SQL. It’s not too fast or hard, and will let them be sure they have a grounding in good ways to write queries.

Posted in Blog | Tagged , , , , | Comments Off on TSQL for Beginners–#RGCommunityCircle

Methodical Testing

Performance tuning is a challenge for many data professionals. Often, it’s also a task that we struggle to find time to perform in many environments. Developers have new features to build and DBAs have plenty of other work. As a result, performance testing is usually done in a crisis.

Netflix is always looking at performance, since their customers and audience are very sensitive to delays. They wrote a post on examining the performance of a potential technology change, which was a good look at different ways they test the effects of something new. In his case, they talk about the changes they were considering for networking stack. There is some technical discussion of why, but the interesting part of the piece, for me, was the A/B testing section.

They planned an experiment, conducted it, and then measured the results. This wasn’t just a test for a developer workstation, which I’ve seen most people do. This was a test with half a million users. Netflix has over 150mm users, so this isn’t a significant number, but it’s also not a tiny number. It’s enough to look for potential issues, though I’d hope they’d expand this to a 2-5% of users to verify their results before they deploy to everyone.

Too often I see developers assuming a test on their workstation of a very small set of data determines if their approach makes sense. I do believe that is a good place to start, but before getting too far along deploying your changes, some significant scale test ought to occur, with repeatable measurements. If you want to ensure your auditing trigger or update code or anything else that might impact lots of users will cause issues, test on a larger set of data. Then repeat the test and verify that your results make sense.

Testing is a skill. A bit of an art, but very much a science. You should make sure you use test harnesses that are large once you think your code works, just to be sure it does. If you want ideas on how, Jeff Moden and Dwain Camps have a few articles that might help.

Steve Jones

Listen to the podcast at Libsyn, Stitcher or iTunes.

Posted in Editorial | Tagged | Comments Off on Methodical Testing

Daily Coping 7 May 2020

I’ve started to add a daily coping tip to the SQLServerCentral newsletter, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

Let someone you love know how much they mean to you.

An easy one for me. This has been a hard time for everyone in my family, for different reasons. My wife is the most important person in the world, and I’ve been making an effort to tell her that more often during these times.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 7 May 2020