Announcement

Collapse
No announcement yet.

Default Database Engine

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Default Database Engine

    We changed the database engine on the server. Now whenever new tables being created, the EspoCRM interface are being created using another engine type.

    I've found the following code at application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php:

    protected function _getCreateTableSQL($tableName, array $columns, array $options = array())
    {
    if (!isset($options['engine'])) {
    $options['engine'] = 'MyISAM';
    }
    return parent::_getCreateTableSQL($tableName, $columns, $options);
    }

    This is great. However, I can't find any place to set the $options['engine']

    Where do we find the config file to set the default $options['engine']?

  • #2
    Hi
    application/Espo/Core/Utils/Database/Schema/tables/actionHistoryRecord.php
    An example is here

    Comment


    • #3
      The database tables were being created as InnoDB until recently. I applied the 4.8.2 update and it seems like any of the more recent entities created were actually created as MyISAM. The actionHistoryRecord.php has the engine set to InnoDB. (I am still running 1.25 on this version for the advanced pack also) Is there someplace else that may be causing the tables to be created as MyISAM? I haven't made any changes to the core system or database since the update.

      Comment


      • #4
        MyISAM was chosen a lot of version before as default. Prefer MyISAM because it's faster with select queries.

        MySQL (both MyISAM and InnoDB) has a bad performance when run SELECT on huge table with COUNT function and JOIN another big table. For example, select meetings where a specific user is an attendee.

        application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php

        Comment


        • #5
          My application/Espo/Core/Utils/Database/DBAL/Platforms/MySqlPlatform.php and application/Espo/Core/Utils/Database/Schema/tables/actionHistoryRecord.php files haven't changed.

          Was there anything in the 4.8.2 update that changed the database creation type in a different location from the two files above?

          We prefer using InnoDB because we ran into issues using MyISAM and the table level locking with the number of people we have using the CRM. Our performance was not noticeably impacted by changing to InnoDB other than we no longer had issues with saving error messages coming up. Before we switched, we also had issues where the power went out and damaged a few of our MyISAM tables which is nothing a backup can't fix but still caused downtime that we haven't had since. I can change it in the database but would prefer to just create them as that type in the first place.

          Comment


          • #6
            No. These files weren't changed. But if you changed engine manually before, after upgrade a database was rebuild and engine was changed to MyISAM

            Comment


            • #7
              Hi, is innodb search engine officially supported? there should be no problem using innodb search engine, right? thanks

              Comment


              • tanya
                tanya commented
                Editing a comment
                InnoDB is the default engine. Right.
            Working...
            X