Every Database Has Problems

Every database platform has some strengths and weaknesses. Some more than others. I caught this site (NSFW) from Erik Darling, and it made my day. I was having a tough one when this site got me to smile and chuckle out loud a few times. I especially like the MySQL and SQL Lite links (again NSFW).

Every platform that you might choose to use to back an application can work in many situations. Certainly scale and load are factors to consider, but for the major relational database platforms, most will work fine for many applications. Some might work better than others, but there are always tradeoffs. There are pros and cons. This is also true for the major NoSQL platforms, though most of my experience is with relational ones, so I tend to lean in that direction.

At the same time, any platform can fail horribly.

What’s the difference? Quality database design and software engineering. If you have a knowledgeable staff that works with the platform, they can likely make it work well. If they don’t consider the database impact when they code, or aren’t skilled with that platform, they can easily make it seem like the database doesn’t work well at all. Lots of hardware can help, but it often can’t outrun poor data models, poor query structures, or a lack of indexing.

Quality of code matters, as many data professionals know. We often aren’t given enough time to do the job right, but we know that’s the case. It doesn’t do any good to complain or bemoan the fact that there is never enough time to fix things or improve them.

We need to write better code to start with, which means learning to write better code. Understand what impacts performance, where you can change your patterns and habits. Watch Erik’s posts, learn from Jeff how to build test data sets to stress your queries if you don’t have good test data. Learn to do a better job in the same amount of time.

Changing platforms won’t magically fix things, no matter what your CTO/director/manager thinks. Especially if your team doesn’t already have experience on the new platform.

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Posted in Editorial | Tagged | Leave a comment

Get a Range of Sequence Values: #SQLNewBlogger

I discovered a procedure recently that I wasn’t aware of: sp_sequence_get_range. This post looks at how the proc works.

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

The Setup

I have a sequence object, IDCounter, that is an integer with an increment of 2. The next value that is returned is shown here:

2026-04_0249

The next value returned will be 99 (increment by 2).

However, imagine that I know I need 10 new values. I don’t want a loop to get these values. Instead, I want to move the sequence to 10 values ahead.

These ten values will be 99, 101, 103, 105, 107, 109, 111, 113, 115, 117. The current value should then be 117 if we get 10 rows.

Let’s use sys.sp_sequence_get_range to do this. I’ll use this code:

DECLARE @i SQL_VARIANT
EXEC sys.sp_sequence_get_range @sequence_name = N'dbo.IDCounter', @range_size = 10, @range_first_value = @i OUTPUT
SELECT @i AS RangeStart

I need to use a SQL_VARIANT as the output, though I can cast this to anything once I have the value.

When I run this code, notice the output.

2026-04_0251

Now if I check the metadata, I’ll see the current value below as 117.

2026-04_0252

There are client side applications that gather a bunch of data and know they need to insert xx rows. This helps them both update the sequence and also reserve these values for themselves. Of course, if the application fails, these values might be lost.

SQL New Blogger

A quick post. This took me about 5 minutes to test and about 10 minutes to structure a quick post on something I learned.

As a follow-up, I’ll use another post to show how this works in an application that reserves these values and then another application performs an insert.

You could easily do this on your blog and show some knowledge.

Posted in Blog | Tagged , , | Leave a comment

The New OS Wars

In the last year I’ve seen a lot of statements about data and sovereignty between countries. While there have been concerns in the past, there seems to be more worry around the world with AI services primarily being run by, and hosted by, US companies. Plenty of my customers at Redgate Software have concerns over our ability to see data when we run AI models, though we don’t store the data. Once the session ends, the data is discarded by policy

Recently I saw a piece about France trying to rid itself of the reliance on US technology, specifically the Windows OS from Microsoft. They are looking to move to their own version of Linux, as well as a number of open source software packages. This quote was fascinating to me: “We can no longer accept that our data, our infrastructure, and our strategic decisions depend on solutions whose rules, pricing, evolution, and risks we do not control.”

With AI being added to lots of software, including OSes, I suspect that other countries might look to follow France. I know the EU is looking to move, and Brazil has been trying to use more Linux and OSS for decades. While I find Windows works well, I completely understand wanting to move, especially in this era where many software packages are web-based and can run on a different OS.

SQL Server runs on Linux, and half of my testing is on Linux, since I run SQL Server in a container on my laptop. My desktop still has a native Windows install, but I find it easy to port almost all code back and forth between the two versions. While I understand others might have a preference for PostgreSQL or MySQL or some other OSS platform, I think SQL Server provides a great value for many organizations. I also think it’s incredibly hard to port your software and data from one database platform to another.

I do wonder if governments or organizations outside the US that look to leave Windows will also look to leave SQL Server. It’s one thing to move away from the OS and software like Office. A little training will get most users productive on a new system in a relatively short time. Moving a software application and its database is a much larger challenge.

I expect SQL Server to remain incredibly popular for many years, and with the ability to configure the new AI capabilities to use your own models, I am not sure a country that wants to reduce their reliance on US technology will choose to do so for their databases. They will likely start elsewhere and continue to use SQL Server for years.

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Posted in Editorial | Tagged , , | Leave a comment

Monday Monitor Tips: Oracle Custom Metrics

One of the popular features of Redgate Monitor has been the ability to add custom mertics for various purposes. This has been popular, and along with our curated list at sqlmonitormetrics.com, it’s a feature that’s used by many.

It has been a SQL Server only function for awhile, but customers have requested other platforms. We’ve added the capability for Oracle and PostgreSQL.

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

Adding Custom Metrics

You can see on my custom metric config page that I have a few business metrics added. I recommend these to customers as often a business metric catches an issue before it appears in Perfmon type data. Let’s add a new metric. I’ll click the

2026-04_0236

I’ll click the “Add a custom metric on the right side” and will get a new form.

2026-04_0237

This form used to be mostly the same, but the “Choose where to collect data from” didn’t have a drop down. It only had the 1. Select instances and the 2. Select databases (to the right). This new drop down is where you pick the platform.

2026-04_0238

If I click the drop down, I see three choices: SQL Server, Oracle, and PostgreSQL.

2026-04_0239

I can select Oracle and my select database section disappears. This is because an instance and a database are the same thing in Oracle.

2026-04_0242

If I select PostgreSQL, I can still select databases.

2026-04_0240

The rest of the form works the same way. When I’ve selected Oracle, I get a default query listed that lets me know the structure of my result set. I need to return an integer with the con_id, a metric value that is a scalar and an optional string with details.

From there things work as they do with other metrics.

Summary

This post shows a new capability in Redgate Monitor for Oracle, where you can track your own data, as you see fit, and then let Redgate Monitor alert on changes, graph this over time, and help you better understand your system.

We are enhancing and adding to Redgate Monitor every week, but there are always more things that many of you want, and custom metrics give you the ability to choose what you want to monitor.

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.

Posted in Blog | Tagged , , | Leave a comment