Category: Generic
-
MariaDB 10.1.1: Defragmenting unused space on InnoDB tablespace
Introduction
When you e.g. delete rows, these rows are just marked as deleted not really physically deleted from indexes and free space introduced is not returned to operating system for later reuse. Purge thread will physically delete index keys and rows, but still free space introduced is not returned to operating system and this operation can lead holes on page. If you have variable length rows, this could lead to situation where this free space can’t be used for new […]
-
MariaDB 10.1.1: Monitoring progress and temporal memory usage of Online DDL in InnoDB
Introduction
Online DDL is a new feature in MariaDB 10.0. Online DDL is processed through below 4 tasks in sequence.
- InnoDB::ha_prepare_inplace_alter_table(..)
- InnoDB::ha_inplace_alter_table(..)
- InnoDB::ha_commit_inplace_alter_table(..)
- mysql_rename_table(..)
-
MariaDB 10.1.1: FLUSH and SHOW for plugins
One of the most popular plugin types both in MariaDB and MySQL is INFORMATION_SCHEMA plugin type. INFORMATION_SCHEMA plugins add new tables to the INFORMATION_SCHEMA. There are lots of INFORMATION_SCHEMA plugins, because they can be used to show just anything to the user and are very easy to write.
MariaDB 10.1.1 comes with nine INFORMATION_SCHEMA plugin: Feedback — shows the anonymised server usage information and can optionally send it to the configured url. Locales — lists compiled-in server locales, implemented by Roberto […]
-
MariaDB 10.1.1: Compound statements
Every now and then there is a need to execute certain SQL statements conditionally. Easy, if you do it from your PHP (or Java or whatever) application. But if all you have is pure SQL? There are two techniques that MariaDB and MySQL use in the mysql_fix_privilege_tables.sql script (applied by mysql_upgrade tool).
- Create a stored procedure with
IFstatements inside, call it once and drop it. This requires the user to have theCREATE ROUTINEprivilege andmysql.proctable must exist and be usable (which is not necessarily true — we’re doing it from mysql_upgrade, right?). - Use dynamic SQL, like
SET @str = IF (@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log ( event_time TIMESTAMP(6) NOT NULL, user_host MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL ) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt;which is not very readable and doesn’t work well if you need to execute many statements conditionally.
- Create a stored procedure with
-
MariaDB 10.1.1: no more .frm’s for performance_schema tables
Yes! In MariaDB 10.1.1 tables in PERFORMANCE_SCHEMA do not use .frm files. These files are not created, not read — in fact, PERFORMANCE_SCHEMA tables never touch the disk at all.
This became possible due to a lesser-known feature of MariaDB — new table discovery (“old table discovery” was implemented in MySQL for NDB Cluster in 2004), implemented in MariaDB 10.0.2. Instead of reading and parsing .frm files, MariaDB simply asks PERFORMANCE_SCHEMA table, what structure it has, and because these tables […]
-
MariaDB 10.1.1: default roles
As you all know MariaDB supported roles since the MariaDB release 10.0.5. They were implemented almost exactly as specified in the SQL Standard 2003, features T331 “Basic roles” and T332 “Extended Roles”.
But we were often hearing complains, users were not satisfied with purely standard set of features. In particular, the standard specified that one had to do
to be able to use privileges, granted to the role foobar. This was not always convenient and sometimes not even possible (imagine, […]
-
Update on Performance measurement on MariaDB 10.1 and MySQL 5.7.4-labs-tplc
Introduction
This blog is a follow up to my original blog in https://blog.mariadb.org/performance-evaluation-of-mariadb-10-1-and-mysql-5-7-4-labs-tplc/ . First of all I would like to thank for all the comments I received. Based on the comments there was a concern if the differences seen on performance was due to different configuration setup. Furthermore, I did not know that there was a configuration variable to get similar multi-threaded flush mechanism on MySQL as there is on MariaDB. To find out if the different configuration variables […]
-
Eventually Consistent Databases: State of the Art
Introduction
Eventual consistency [1] is a consistency model, which is used in many large distributed databases. Such databases require that all changes to a replicated piece of data eventually reach all affected replicas. Furthermore, the conflict resolution is not handled in these databases, and the responsibility is pushed up to the application authors in the event of conflicting updates. Eventual consistency is a specific form of weak consistency: the storage system guarantees that if no new updates are made to […]