PT-Query-Digest (Creation Database)

Good morning,

I can see in the source code of pt-query digest the db always try to be created

This shouldn’t be a problem but recently we have noticed this could drive to trigger the conflict resolution on mariadb - galera.

Do you think there is a possibility to add a flag to pt-query-digest to control the creation database?

Thanks in advace for your inputs.

Hi @David_Martinez,
This table/database are only created when using the --review flag. Are you needing this? If not, remove the flag and the db/table will not get created.

If you do need the table, can you share some details of the conflict? I can’t think of a situation in Galera where a table already exists on all nodes and CREATE TABLE causes an issue. Have you tried truncating the table beforehand?

You might try using --set-vars wsrep_osu_method=RSU instead of TOI. That will prevent the table from being replicated, but that could cause other issues if you write to that table from another node where it does not exist.

Hi @matthewb

thanks a lot for your repply.

WE have tried with and without the --review flag but still see it tries to CREATE DATABASE. Please refer Im not talking about create table.

As I can see in the code, there is no option to avoid the CREATE DATABASE. Am I right?

If you want I can share what kind of setup drives those certification errors when the create database happens.

David M.

Looking at the source code, only --review and --history will trigger the CREATE DATABASE. Additionally, if you don’t supply a DSN, then the tool can’t login to MySQL and therefore can’t create anything.

@matthewb agree with you, review and history triggers that option but there is no way to control if we dont want to create the DB itself, right?

On our logic, we want to get historical data from slow log thats why we are using that flag so do not supply a DSN doesn’t sound like a valid option for us as of now.

Hi @David_Martinez,
I suggest you open a feature request on for a --no-create-database flag to be added. We have similar flags on other Percona Toolkit tools, so it shouldn’t be too hard to add. Be sure to note this is Galera related.

On the other side, if you want historical query reviews, why not use PMM? All of the same functionality of pt-query-digest but without the hassle of having to run pt-q-d all the time. PMM is essentially a “live” pt-q-d with full history, examples, EXPLAIN, and table status all in one web UI. If there’s something preventing you from running PMM in your environment, our engineers would like to know your blockers.