News

Partial restore on MySQL or PXC

Shinguz - Mon, 2021-02-22 14:55

The receipt above seems also to work with Percona Xtrabackup:

First you have to disabled the PXC strict mode: pxc_strict_mode = disabled. Then you have to copy the *.{exp|cfg|ibd} files to the right location and import the tablespaces again.

We further found, that an --export on an already prepared backup seems to be possible with xtrabackup.


Taxonomy upgrade extras: 

Galera Cluster Release Notes

Shinguz - Fri, 2021-02-19 21:32

Window functions

Shinguz - Wed, 2021-02-17 07:58

Some of my colleagues mentioned Window Functions. Maybe it works. But I fear that window functions are not fast because they do some materialization in between? I have to test...


Taxonomy upgrade extras: 

Databases are standardized but in detail they behave different

Shinguz - Wed, 2021-02-10 11:47

For a fancy application we want to query a chunk of rows from a table and therefore we need the minimum and the maximum of the Primary Key of these rows.
Because InnoDB is an Index Organized Table or Index Clustered Table we know that this access will use the Primary Key. But to be sure and to be compliant with the standard (and compatible) we use and ORDER BY on the Primary Key.

MySQL 5.7

First we create some test data:

mysql> CREATE TABLE t_my (
  ID CHAR(32) NOT NULL PRIMARY KEY
) ENGINE = InnoDB; …

Taxonomy upgrade extras:  Postgresql  Sqlite  Sql Server  Oracle  Mysql 

Handler_read_first

Shinguz - Mon, 2021-02-08 09:35

We got some feedback from Paul Campbell about Handler_read_first:

Thought you might like to know that you can get do this without a full index scan (in 5.7 at least) with a query for SELECT MIN(pkey), only the first key is read in this instance. SELECT MAX(pkey) will do the same for Handler_read_last.

e.g.

mysql> EXPLAIN select min(a) from t2;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+------------------------------+
| id | select_type | …

Taxonomy upgrade extras: 

FromDual Backup and Recovery Manager for MariaDB and MySQL 2.2.3 has been released

Shinguz - Mon, 2021-01-18 14:35

FromDual has the pleasure to announce the release of the new version 2.2.3 of its popular Backup and Recovery Manager for MariaDB and MySQL (brman).

The new FromDual Backup and Recovery Manager can be downloaded from here. The FromDual Repositories were updated. How to install and use the Backup and Recovery Manager is described in FromDual Backup and Recovery Manager (brman) installation guide.

In the inconceivable case that you find a bug in the FromDual Backup and Recovery Manager please report it to the …


Taxonomy upgrade extras:  Backup  Restore  Recovery  Pitr  Brman  Release  Bman  Rman  Fromdual Backup and Recovery Manager 

MariaDB Push Replication

Shinguz - Mon, 2021-01-11 17:29

Table of Contents

How to make MariaDB Pull Replication as secure as possible

A normal MariaDB Replication is a Pull Replication. This means that a Slave connects to its Master and gathers or better requests Binary Log information from the Master and applies them in a streaming way.

In some set-ups the Slave is …


Taxonomy upgrade extras:  Mariadb  Replication  Security 

VSZ behaviour with MariaDB MEMORY tables

Shinguz - Tue, 2021-01-05 17:08

We recently had the situation that a customer complained about the Oom killer terminating the MariaDB database instance from time to time. The MariaDB database configuration was sized quit OK (about 50% of RAM was used for the database) but they did not have swap configured.

When we checked the memory for the specific mysqld process we found that VSZ was about 80 Gibyte (on a 64 Gibyte machine) and the RSS size was about 42 Gibyte. The very high VSZ value in combination with a lacking swap space and Oom …


Taxonomy upgrade extras:  Memory Table  Memory  Oom  Swap 

MariaDB memory_used

Shinguz - Tue, 2021-01-05 17:48

An inside view from the MariaDB database instance can be received with:

SQL> SHOW GLOBAL STATUS LIKE 'memory_used';
+---------------+------------+
| Variable_name | Value      |
+---------------+------------+
| Memory_used   | 3235456112 |
+---------------+------------+

Here the memory is listed as released when the TRUCATE TABLE is done.


Taxonomy upgrade extras: 

Use Mirror Router instead

Shinguz - Mon, 2021-01-04 16:57

I just got a note from Markus Makela with the following suggestion:

You could try and see if the mirror router from the experimental module package would work as a substitute for this.


Taxonomy upgrade extras: 

Traffic mirroring with MariaDB MaxScale

Shinguz - Thu, 2020-12-24 16:27

Recently we had the case that a customer claimed that MariaDB 10.3 Binary Log is using 150% more space on disk than MySQL 5.7 Binary Log. Because I never observed something similar, but to be honest, I did not look to intensively for this situation, we had to do some clarifications.

First we checked the usual variables which could be candidates for such a behaviour:

binlog_format                = ROW
binlog_row_image             = FULL
binlog_rows_query_log_events = OFF   # MySQL only …

Taxonomy upgrade extras:  Mariadb  Maxscale  Binary Log  Load Balancer 

MariaDB Galera Cluster Upgrade Path

Shinguz - Fri, 2020-12-18 10:47

Because we conduct many customers in MariaDB Galera Cluster upgrades and because these customers sometimes have pretty old MariaDB Galera Cluster set-ups I think it is good to have a rough MariaDB Galera Cluster Upgrade Path.

For an Upgrade Path we have to consider a few things:

  • We face different MariaDB Galera Cluster version (5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5 and soon 10.6).
  • We face different Galera plug-in versions (v2, v3 and v4). Direct upgrade from v2 to v4 is not possible. Upgrade from latest …

Taxonomy upgrade extras:  Mariadb  Galera  Cluster  Upgrade 

A note about the described problem

Shinguz - Thu, 2020-12-10 21:40

Hi Oli,

I think that it could be worth mentioning that in MariaDB 10.5, the described problem should no longer exist, thanks to https://jira.mariadb.org/browse/MDEV-19747 removing the code. Also, in older MariaDB versions, https://jira.mariadb.org/browse/MDEV-23720 disables the feature by default.

I must confess that omitting the redo logging was my suggestion. Unfortunately, no proper benchmarking was conducted before it was implemented in MySQL 5.7. With a reasonable innodb_log_file_size, …


Taxonomy upgrade extras: 

How to force InnoDB Buffer Pool flushing

Shinguz - Thu, 2020-12-10 17:38

InnoDB tries to keep pages in Buffer Pool to be fast. If a page is changed by a DML statement (INSERT, UPDATE, DELETE) this change will be done in InnoDB Buffer Pool and not directly on disk. But those changed InnoDB pages residing in InnoDB Buffer Pool must be flushed sooner or later to disk to become persistent. This is done by the InnoDB background writer thread(s) (default 4).

InnoDB flushes the dirty pages with a pace of innodb_io_capactiy (default 200) pages/s. This variable should be set depending on …


Taxonomy upgrade extras:  Innodb  Buffer Pool  Flushing  Meb  Mysql Enterprise Backup  Backup 

Upgrading from MariaDB 10.4 to MariaDB 10.5 Galera Cluster

Shinguz - Sat, 2020-11-21 20:58

Because upgrading from MariaDB 10.4 to MariaDB 10.5 (non-clustered) seems not to be a problem
[ 1
] we take the challenge and try to create a receipt based on the MariaDB 10.3 to MariaDB 10.4 Galera Cluster upgrade documentation
[ 3
]:

Before you start

Before you begin with the upgrade you should consider a few things:

  • Downgrade is officially not supported!
    [ 4
    ] It might work, or not.
  • So you should have taken a proper an clean backup before you start with the upgrade and you should be sure the restore …

Taxonomy upgrade extras:  Mariadb  Upgrade  Cluster  Galera Cluster  Rolling Upgrade  10.4  10.5 

Partial Restore of a Table into a MariaDB Galera Cluster

Shinguz - Fri, 2020-11-20 15:08

In my former Blog Post Partial Table or Schema restore from mariabackup full backup we worked out the basics of a partial restore of a table into a MariaDB database instance.

An now we use this know-how to try the same procedure on a Galera Cluster.

The backup is done in the exact same way as described in the mentioned article. We can even use the backup made there.

For the restore we use the following procedure:

Prepare and Restore a table

# BACKUPDIR="/home/mysql/bck/qamariadb105/daily"
# …

Taxonomy upgrade extras:  Backup  Restore  Schema  Database  Physical Backup  Mariabackup  Table Restore  Schema Restore  Partial Restore  Database Restore 

Partial Table or Schema restore from mariabackup full backup

Shinguz - Wed, 2020-11-11 21:59

For me it was for a long time not clear if a mariabackup full backup can be used to do partial table or schema restores. Now we faced this challenge with a customer. So time to try it out…

This test was made with MariaDB 10.5.5. So it may not work with some older MariaDB releases…

Backup

Because I do not know during the backup if I need a full or a partial restore I always want to do a full mariabackup backup!

The full backup can be done as normal but the prepare should not be done yet during …


Taxonomy upgrade extras:  Backup  Restore  Schema  Database  Physical Backup  Mariabackup  Table Restore  Schema Restore  Partial Restore  Database Restore 

MariaDB MaxScale Configuration Variables

Shinguz - Wed, 2020-11-04 22:49

Table of Contents

Global Options

VariableVersionsValuesDefaultUnitComment
threads1.4 2.32.42.5{ <n> | auto }1thread 
thread_stack_size 2.2   <n>  Ignored and deprecated in 2.3
rebalance_period    2.5<n>0second 
rebalance_threshold    2.5<n>20delta load 
rebalance_window    2.5<n>10second …

Taxonomy upgrade extras:  Mariadb  Maxscale  Configuration  Variables  Load Balancer 

FromDual Backup and Recovery Manager for MariaDB and MySQL 2.2.2 has been released

Shinguz - Wed, 2020-10-14 14:22

FromDual has the pleasure to announce the release of the new version 2.2.2 of its popular Backup and Recovery Manager for MariaDB and MySQL (brman).

The new FromDual Backup and Recovery Manager can be downloaded from here. The FromDual Repositories were updated. How to install and use the Backup and Recovery Manager is describe in FromDual Backup and Recovery Manager (brman) installation guide.

In the inconceivable case that you find a bug in the FromDual Backup and Recovery Manager please report it to the …


Taxonomy upgrade extras:  Backup  Restore  Recovery  Pitr  Brman  Release  Bman  Rman  Fromdual Backup and Recovery Manager 

SQL Query Tuning - Performance

Shinguz - Mon, 2020-10-05 16:13

How could the following SQL queries be improved performance wise and otherwise and can you also explain why your change is more optimal?

Please consider, when testing, that your results are not confused by the Query Cache or by reading data from your I/O system which are an order of magnitude faster (Query Cache) or slower (I/O) than the in-memory behaviour.

Table of Contents


Taxonomy upgrade extras:  Query  Tuning  Optimizer  Sql  Performance 

Pages

Subscribe to FromDual aggregator - FromDual all (en)