Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional sql optimization for drupal #467

Open
jeff1evesque opened this issue May 18, 2016 · 0 comments
Open

Additional sql optimization for drupal #467

jeff1evesque opened this issue May 18, 2016 · 0 comments

Comments

@jeff1evesque
Copy link
Owner

jeff1evesque commented May 18, 2016

After #464, we will optimize our database implementation, by creating puppet equivalent logic:

  • change the overall transaction isolation (i.e. tx_isolation) on the sql database from REPEATABLE-READ to READ-COMMITTED:
SET tx_isolation = 'READ-COMMITTED';
  • Move semaphore sql table implementation from innodb to memory:
MariaDB [db_drupal]> ALTER TABLE semaphore ENGINE = MEMORY;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> ALTER TABLE semaphore DROP PRIMARY KEY;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> ALTER TABLE semaphore ADD PRIMARY KEY (name, value) USING BTREE;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> ALTER TABLE semaphore ADD UNIQUE name (name) USING BTREE;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> ALTER TABLE semaphore DROP INDEX value;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> ALTER TABLE semaphore ADD INDEX value (value) USING BTREE;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> ALTER TABLE semaphore DROP INDEX expire;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> ALTER TABLE semaphore ADD INDEX expire (expire) USING BTREE;
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [db_drupal]> show table status where Name = 'semaphore';
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

Note: the following indicates the motivation for implementing the memory engine, instead of innodb, for the drupal semaphore table:

Drupal supports multiple database backends, but both MEMORY and the concept of storage engines as a whole is MySQL specific. Therefore, the Schema API has no support for specifying the storage engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant