Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28410

probleme de performance powerbi requetant mariaDB

Details

    Description

      Bonjour,
      un applicatif métier nous impose un moteur mariaDB 10.1.34 installé sous un windows serveur 2016 64bits.
      L'applicatif en lui même n'a aucun problème de performance.
      L'architecture de l'applicatif est : 1 client = 1 base.
      Nous avons environ 450 clients, donc l'instance mariaDB contient 450 bases.

      Par contre, nous avons démarré un projet de reporting basé sous powerbi.
      La version de powerbi est la version desktop de mars 2022 64bits et on utilise le connecteur ODBC pour mariaDB version 3.1.15
      La connexion à la base ne pose pas de problème, mais dès lors qu'on souhaite visualiser ou importer une table dans powerbi, cela prend environ 10 min alors que les tables sont très petites (<1000lignes)
      Dans le moteur mariaDB, on voit que powerbi genere des requetes dans la base information_schema et ce sont ces requetes qui posent problème.

      Voici l'une des requêtes, qui prend environ 10 min, 1vCPU et environ 4Go de RAM avant de retourner aucune données:
      select
      fkcol.REFERENCED_COLUMN_NAME as PK_COLUMN_NAME,
      fkcol.TABLE_SCHEMA AS FK_TABLE_SCHEMA,
      fkcol.TABLE_NAME AS FK_TABLE_NAME,
      fkcol.COLUMN_NAME as FK_COLUMN_NAME,
      fkcol.ORDINAL_POSITION as ORDINAL,
      concat(fkcon.CONSTRAINT_SCHEMA, '_', fkcon.CONSTRAINT_NAME) as FK_NAME
      from
      INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS fkcon
      inner join
      INFORMATION_SCHEMA.KEY_COLUMN_USAGE fkcol
      on fkcon.CONSTRAINT_SCHEMA = fkcol.CONSTRAINT_SCHEMA
      and fkcon.CONSTRAINT_NAME = fkcol.CONSTRAINT_NAME
      where fkcol.REFERENCED_TABLE_SCHEMA = '******' and fkcol.REFERENCED_TABLE_NAME = '******'
      and fkcol.ORDINAL_POSITION = fkcol.POSITION_IN_UNIQUE_CONSTRAINT
      order by concat(fkcon.CONSTRAINT_SCHEMA, '_', fkcon.CONSTRAINT_NAME), fkcol.ORDINAL_POSITION;

      J'ai montée une autre instance en 10.1.34 avec seulement la base qui m'intéressait, et dans cette configuration, le requêtage est instantané.

      Est ce que c'est un bug? un problème de configuration? un problème d'architecture de base ?

      Merci pour votre aide!

      JM

      Attachments

        Issue Links

          Activity

            JM974 JM974 added a comment -

            I tried mariadb AND mysql ODBC connectors.

            And the results are the same.

            thx

            JM974 JM974 added a comment - I tried mariadb AND mysql ODBC connectors. And the results are the same. thx

            Hi JM,
            I'm using mysql 8 and got the same issue with powerbi.
            Just found this problem here because I was thinking about trying mariadb.

            We found out how to disable these queries in powerbi, so the reports refresh fast again.
            You can deactivate it by unchecking the "Include relationship columns" under advanced options.
            Or directly in the M-Query Options by setting the `CreateNavigationProperties` to `false` (https://docs.microsoft.com/en-US/powerquery-m/mysql-database)
            Hopefully, this helps you as well.

            HoelShare Sebastian Hölscher added a comment - Hi JM, I'm using mysql 8 and got the same issue with powerbi. Just found this problem here because I was thinking about trying mariadb. We found out how to disable these queries in powerbi, so the reports refresh fast again. You can deactivate it by unchecking the "Include relationship columns" under advanced options. Or directly in the M-Query Options by setting the `CreateNavigationProperties` to `false` ( https://docs.microsoft.com/en-US/powerquery-m/mysql-database ) Hopefully, this helps you as well.
            JM974 JM974 added a comment -

            Hi Sebastian,

            thank you so much for the tip. it works perfectly well and solves my problem!

            However, I have to user mysql connector in order to see the "include relationship columns" parameter.
            The mariadb connector doesn't have this feature ...

            Thx again.

            regards
            JM

            JM974 JM974 added a comment - Hi Sebastian, thank you so much for the tip. it works perfectly well and solves my problem! However, I have to user mysql connector in order to see the "include relationship columns" parameter. The mariadb connector doesn't have this feature ... Thx again. regards JM

            MySQL's driver used to have option not to use INFORMATION_SCHEMA for catalog functions, but to process output of different SHOW commands (with sometimes lower data quality as a trade off). The name, out of top of my head, was NO_I_S.
            We could add the similar option, if I_S queries cannot be made faster. I don't quite like the idea, but that can be done faster, than server gets fix for this. I will also take a look if maybe the query can be optimized.
            I've created ODBC ticket and linked to this issue.

            Lawrin Lawrin Novitsky added a comment - MySQL's driver used to have option not to use INFORMATION_SCHEMA for catalog functions, but to process output of different SHOW commands (with sometimes lower data quality as a trade off). The name, out of top of my head, was NO_I_S. We could add the similar option, if I_S queries cannot be made faster. I don't quite like the idea, but that can be done faster, than server gets fix for this. I will also take a look if maybe the query can be optimized. I've created ODBC ticket and linked to this issue.

            The corresponding ODBC ticket has been closed. SQLForeignKeys has been optimized and this change will be int he 3.2.2 release. It supposed to happen soon, but if anybody is willing to test it earlier - ping me, probably better at the ODBC ticket

            Lawrin Lawrin Novitsky added a comment - The corresponding ODBC ticket has been closed. SQLForeignKeys has been optimized and this change will be int he 3.2.2 release. It supposed to happen soon, but if anybody is willing to test it earlier - ping me, probably better at the ODBC ticket

            People

              Lawrin Lawrin Novitsky
              JM974 JM974
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.