It is not uncommon for an application to use WHERE conditions like this: WHERE status = 'DELETED' OR status IS NULL If you run EXPLAIN, such conditions typically only cause the type column to be show ref_or_null. Whereas, without the...
Federico Razzoli
How to monitor that AUTO_INCREMENT columns won’t reach their limit
AUTO_INCREMENT primary keys are useful, because they save us the trouble to generate a unique value for every row, delegating this task to the database. But when we reach the limit we need to take some action, or we won’t be able to insert more rows. On 5 May...
5 benefits of Infrastructure As Code
Infrastructure As Code is a paradigm that consists of describing our infrastructure (servers and their configuration) as code that is understood by automation software like Ansible, Puppet, Terraform, and so on. Automation software can then be used to recreate the...
MariaDB/MySQL: use SQL properly to run less queries
Sometimes it is possible to do with one query what most people would do with two or more queries. This is done by using expressive SQL syntax that is often ignored. This principle applies to any database, but this article focuses on MySQL and MariaDB syntax. Why...
The risks of MySQL release policy
A traditional software release circle starts with intensive development. The release early, release often model suggests to release incomplete, unstable versions as early as possible, making it very clear that they shouldn't be used in production. At some point the...
When to use NULLable columns in relational databases
In the article What does NULL mean in SQL? I explained why I consider SQL NULL inconsistent. As a general rule, I should have made clear that I don’t think it is a good idea to use NULL, even if columns are NULLable by default in SQL....
READ ONLY transactions in MariaDB and MySQL
Transactions are the least known RDBMS features. Everyone knows they exist, but few know how they work. For this reason, it is not obvious that they can be read only. This article explains what read only transactions are and why we should use them when appropriate....
Using CONNECT to access remote MariaDB or MySQL tables
CONNECT is a powerful MariaDB storage engine designed to access remote data sources, using them as if they were local relational tables. We can query these tables and write data into them. While CONNECT supports a huge range of different data sources, the most common...
A MariaDB Server Fest 2020 review
As the strange times we live in impose to temporarily avoid events that imply physical gatherings, great virtual events are taking place. One of them was MariaDB Server Fest, organised by the MariaDB Foundation. Federico Razzoli from Vettabase gave two talks at the...
The most dangerous SQL statement
We asked this question on Twitter: what is the most dangerous SQL statement? https://twitter.com/vettabase/status/1303636207096795136?s=20 We didn't get many answers, but all of them were good and will be mentioned here! But first of all: the question is ambiguous, on...