Tag: syndicated

  • Car Update October 2026

    This month I want to look at a few of the things I’ve seen posted about cars during the last month. These are a few headlines, as well as some questions I’ve seen on Quora around EVs. Lots of people still worry about the cost and time for charging, so I wanted to add some notes based on my experiences.

    I don’t think EVs are good for everyone, and for most people, this is likely a bit of a calculation that you have to make for your situation.

    UPDATE: I had the Escape cost at $0.81. It’s $0.081.

    Charging Costs

    My cost of power is (usually) $0.14/kWh. There can be a higher charge if I pull power between 4p and 8p, but I can avoid that with scheduled charging. You have to input your own power cost for calculations, which can vary dramatically around the world.

    My Tesla used to use around 260Wh/mi over the long term (75k miles). For the Lucid Gravity, I tend to use more like 285Wh/mi. Those are strange numbers, but if I convert those to a per-mile cost, I get something like:

    • 2021 Tesla MY – $0.036 / mi
    • 2026 Lucid Gravity – $0.04/mi

    These can be compared to my other cars. For comparison, I’ll use my older cars, with a few stats.

    • 2012 BMW X5 – 23mpg
    • 2021 Ford Escape Hybrid – 48mpg
    • 2022 RAM 3500 – 12mpg
    • Gas in the Denver – avg about $3.90 today
    • Diesel in Denver – avg about $5.40

    If I use those numbers, I get calculations that look like this:

    • Tesla MY – $0.036 / mi
    • Lucid Gravity – $0.04/mi
    • 2012 BMW X5 – $0.17/mi
    • 2021 Ford Escape Hybrid – $0.08
    • 2022 RAM 3500 – $0.45

    Clearly the truck is the worst, but a gas SUV which is about the same size as the Tesla, is 5x more expensive to run. The Lucid is larger, and it’s 4x more expensive. Even the hybrid is 2x+ more than the EV.

    There are also the maintenance costs, which are higher, but the quicker tire wear from the EVs offsets some of this for regular maintenance. For longer term stuff, gas cars cost more to maintain.

    What does this mean? I tend to drive in the 12k-15k a year range. At 15k, this is:

    • Tesla MY – $546
    • Lucid Gravity – $600
    • 2012 BMW X5 – $2.550
    • 2021 Ford Escape Hybrid – $1,220
    • 2022 RAM 3500 – $6.750

    The truck tends to run just a few thousand miles, but those are pretty good costs. My charging station cost me $750 installed, which is slightly above the savings from the hybrid. Across 2 years, it’s not close.

    However, if you spend more on power, or your charging station costs more, or you charge at expensive public chargers (Denver Superchargers can be $0.50-0.60), then the savings go away.

    Of course, if you can charge at home, you have lots of time savings as well over the year.

    Charging Time

    What about time? There are plenty of horror stories where people say it took an hour or more to charge. That’s a common concern, as the 0-100 time for a large battery, say 80-100kWh can be high.

    I charge at home, and in 5+ years of owning EVs, I have probably charged 30 times away from home. That’s about 6 times a year. I think the longest I charged was about 45 minutes while eating dinner, but we didn’t need to charge that long.

    Almost all of my charges were while traveling away from home and staying overnight. Most of those sessions were 15-20 minutes. The EVs calculate how much charge you need to get to your destination, which isn’t something most of us are used to with gas/diesel cars. We think in terms of miles.

    For me, 99.9% of the time, I plug in at night (10s) and unplug the next day (10s) and that’s it. Almost never do I exceed a 200mi a day drive. If I do, I might or might not charge. If I’m going 300 mi, which I have done, I would likely charge somewhere along the way for 10 minutes, which is about what a gas stop is with a fill up, bathroom break, purchase a coffee.

    Overnight, whether I’m at 10% of 60%, the car is charged by 7am. I typically set my charger at 34A and start at 10p. Most of the time it’s a 2-3 hour charge if I’ve been driving around.

    Plenty of people worry about taking a long trip. If you do that a lot, then you have to make a calculation of how much extra time you might need. For lots of people this is maybe an hour or two on a long trip, like 1,000 miles.

    How often do you do that? Almost never for most of us. If I were pressed for time on a long trip, say an 8 hour drive to Omaha (600 miles), I’d likely rent a car. Heck, I’ve done that in the past to not wear my car and tires. Otherwise, I’d stop and charge at a few places. The EVs might stop you with 50% to charge or 20% to charge, depending on where chargers are, and they calculate a minimum charge time, so you are often only stopping for 15 minutes.

    The reality in my experience, and in a few friends that have purchased EVs is that the “long trip” isn’t really a common occurrence or issue. Think ahead and make the decision that makes sense.

    Of course, I have a friend in an apartment, no charging available. He sometimes has run an extension cord at 110V to add 4-5mi overnight to his car, but he tends to just use public chargers a few times a week, letting the car charge while he shops or eats nearby.

    If you drive a lot, and you have time constraints, charging might be an issue. That’s not most people.

    Is It Worth Buying an EV?

    To me, with no real cheap EVs in the US, I think it’s worth exploring if you want a new or used car at the EV price points. It’s not likely worth it to change your existing car if you’re happy with it.

  • Experimenting with CHOOSE: #SQLNewBlogger

    I was looking over the CHOOSE() function while editing an article at SQL Server Central. I realized there isn’t a documentation note on how many parameters can be included. I decided to test.

    This post looks at the tests and results.

    Tl;dr It appears 3925 is the most arguments.

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    Building a Script

    Since I want to know where things fail, I decided to make a short T-SQL script that tests increasing numbers of parameters. This script builds a dynamic CHOOSE() select using a number of parameters and then loops for a set number of times, adding 1 parameter each time.

    SET NOCOUNT ON; DECLARE @MaxValues int = 5150; -- largest number of CHOOSE value arguments DECLARE @n int = 300; -- current number of value arguments DECLARE @i int; DECLARE @idx int; DECLARE @args nvarchar(max); DECLARE @sql nvarchar(max); WHILE @n <= @MaxValues BEGIN -- Build value list: 'Value 1', 'Value 2', ... 'Value n' SET @args = N''; SET @i = 1; WHILE @i <= @n BEGIN SET @args += CASE WHEN @i > 1 THEN N', ' ELSE N'' END + N'N''V' + CAST(@i AS nvarchar(10)) + N''''; SET @i += 1; END; -- Random index in 1..n (CHOOSE is 1-based; out of range returns NULL) SET @idx = ABS(CHECKSUM(NEWID())) % @n + 1; SET @sql = N'SELECT ' + CAST(@n AS nvarchar(10)) + N' AS ArgCount, ' + CAST(@idx AS nvarchar(10)) + N' AS PickedIndex, ' + N'CHOOSE(' + CAST(@idx AS nvarchar(10)) + N', ' + @args + N') AS Result;'; PRINT @sql; -- show the generated statement EXEC sys.sp_executesql @sql; -- run it SET @n += 1; END;


    This returns the command run. For the first 2 values of n, setting @n to 1 and @max to 2, I get this:

    SELECT 1 AS ArgCount, 1 AS PickedIndex, CHOOSE(1, N'V1') AS Result;
    SELECT 2 AS ArgCount, 1 AS PickedIndex, CHOOSE(1, N'V1', N'V2') AS Result;

    This let me test different values. I tried various values and eventually got this error:

    2026-09_0159

    I tried this a few different times, disconnecting and reconnecting and it seemed that I could get the number of parameters up to 3925. It failed sometimes at 3924 and sometimes at 3925.

    I’ve submitted a PR to add the max number to the docs, but it appears CHOOSE() works at a level that would cover lots of items. I see this as a small syntactic sugar add, and if I really needed to index 1000 entries, a join with a reference table would be a better choice.

    SQL New Blogger

    This script took a few minutes to write, but the testing took about 45 minutes. I was running this in the background with different values. 1..256, 255..1024, etc. I noticed that SSMS responded slower, so I started jumping to small ranges at large values to find the error.

    This post took me about 20 minutes to put together after the testing, which included the PR for Microsoft. This is an easy way to show that you can examine possibilities and find the limits of your code. That helps us decide how scalable or robust our solutions are.

    You could write this post and impress an interviewer. Choose your own T-SQL function and run an experiment.

  • A Fun Prize at the PASS Data Community Summit

    I had a briefing for the 2026 PASS Data Community Summit, which is just a couple of weeks away. Amongst a bunch of admin type stuff, there was a slide with a picture of the Redgate Software prize at our booth.

    It’s a Lego Concorde model. That is very cool.

    2026-10_0144

    If you’re attending the Summit, swing by and enter for your chance to win. It’s a pricey (to me) set, though I might have to get one and put a shelf behind my desk with it, and a few other things I need to get on display.

  • Monday Monitor Tips: Query Recommendations

    We keep adding stuff to Redgate Monitor, and it’s easy to miss some of the improvements. Here’s one that’s been around quite awhile, but while discussing the product with a customer who uses Redgate Monitor, I realized they weren’t aware of this.

    This is part of a series of posts on Redgate Monitor. Click to see the other posts.

    The Blue Blob

    I was looking at a set of queries on the SSC servers with an SE and a customer. The SE pointed out that we surface some code issues on this page. There’s a blue lightbulb next to one of the queries.

    2026-06_line0007

    I’ve zoomed in, but if you go to monitor.red-gate.com, you’ll find this somewhere in the list. This is to the right, where the database name is listed.

    2026-06_line0006

    If we expand this query from the left side (the arrow), we see details, but below the plan handle, we’ve noted that Redgate Monitor has run code analysis and identified an issue. In this case, there’s one issue, but I’ve seen 3 or 4 on some client systems.

    2026-06_line0008We can click the blue text above (1 issues with this query) and this opens a dialog where I can see the query and the code analysis issue identified. In this case, we don’t have a schema name in here, which is just poor practice and a potential place you could have issues, if you add schemas and users might have a different default.

    2026-06_line0009

    One cool thing, is that if I click the slide in the upper right, I get a better format for the code.

    2026-09_0164

    Our code analysis rules are documented on our side, and there is a link at the bottom of the dialog that popped up. It’s to the lower right, and I cropped it out to get a slightly better image. If does to the Code Analysis pages at documentation.red-gate.com. Here you can read about our code smells and rules, which are also checked by SQL Prompt.

    Summary

    This is a small thing, but it helps with Operations people who might want to suggest ways that code could be improved, whether to clean up the codebase or for better performance. Once you start to establish guidance, and provide useful solutions, you can collaborate and other changes are possible.

    If you use Redgate Monitor, look for these items and see if you can encourage some refactoring from developers.

    Redgate Monitor is a world-class monitoring solution for your database estate. Download a trial today and see how it can help you manage your estate more efficiently.