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

update defaults and simplify mysqld config parameters

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: None
    • Labels:
      None

      Description

      Poor MySQL has received some negative feedback over the years 1 2. As entertaining as it is watching and listening to developers struggle and whine, I think it's about time we changed some of the defaults and made the config easier to understand.

      Oracle are working on changing more defaults in 5.7 3 4 5, I think we should too.

      Something else they have done, is to radically change the simplicity of the default server config file, /etc/my.cnf:
      https://raw.githubusercontent.com/mysql/mysql-server/5.7/support-files/my-default.cnf.sh

      It's quite clear there, the sql_mode has been set, which will satisfy most developers and users looking for an ACID compliant database with little tweaking, and a rough note on increasing or decreasing RAM needed for InnoDB. MariaDB now probably needs something similar for Galera, CONNET and TokuDB.

      1. http://sql-info.de/mysql/gotchas.html
      2. http://blog.ionelmc.ro/2014/12/28/terrible-choices-mysql/
      3. http://www.tocker.ca/2015/01/23/proposal-to-change-additional-defaults-in-mysql-5-7.html
      4. http://www.tocker.ca/2015/01/14/proposal-to-change-replication-and-innodb-settings-in-mysql-5-7.html
      5. http://www.tocker.ca/2015/02/24/proposal-to-change-additional-defaults-in-mysql-5-7-february-edition.html

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              danblack Daniel Black added a comment -

              Morgan Tocker's defaults, for everything actually in MariaDB, seem quite sane to me. Ref 1 - bit dated.

              Ref 2 interesting rant:

              bad points:

              • seems to oversimplify transactions by assuming the API are the same as the data
              • character collations - rtfm and stop making assumptions.
              • transaction isolation level - wrong reason to change and MySQL backed out of this change
              • doesn't get that null isn't a value

              on the valid good points:

              • sql_mode - http://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_sql-mode - invalid dates part of STRICT_TRANS_TABLES - part of Tocker's changes
              • utf8 - i think where there, +innodb_large_prefix will help with indexes as Tocker point out
              • we have computed columns
              • conditional index - i'm sure there is a feature request somewhere though probably low priority
              • non-transaction DDL/slow alter table - fair point - hard problem - if their south/migration implementer didn't hate mysql could implement pt-online-schema-change in migrations but they won't (with probably good reason)
              Show
              danblack Daniel Black added a comment - Morgan Tocker's defaults, for everything actually in MariaDB, seem quite sane to me. Ref 1 - bit dated. Ref 2 interesting rant: bad points: seems to oversimplify transactions by assuming the API are the same as the data character collations - rtfm and stop making assumptions. transaction isolation level - wrong reason to change and MySQL backed out of this change doesn't get that null isn't a value on the valid good points: sql_mode - http://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_sql-mode - invalid dates part of STRICT_TRANS_TABLES - part of Tocker's changes utf8 - i think where there, +innodb_large_prefix will help with indexes as Tocker point out we have computed columns conditional index - i'm sure there is a feature request somewhere though probably low priority non-transaction DDL/slow alter table - fair point - hard problem - if their south/migration implementer didn't hate mysql could implement pt-online-schema-change in migrations but they won't (with probably good reason)
              Hide
              danblack Daniel Black added a comment -

              As pointed out on irc, sql_mode=STRICT_TRANS_TABLES would of helped prevent https://www.bugzilla.org/security/4.2.14/ .

              A major release is the only time to change these defaults. 10.2 is a long way off.

              So many of these values are already out of date addressing some would be a good start.

              So to give this issue some concrete values (from mysql-5.7 changes):

              • sql_mode = ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION
              • innodb_large_prefix = yes
              • log_slow_admin_statements ON
              • log_slow_slave_statements ON
              • long-query-time 2
              • log-queries-not-using-indexes ON
              • min-examined-row-limit 1000
              • group_concat_max_len 1M
              • max_allowed_packet 16M
              • binlog_format ROW (require for galera)
              • innodb_autoinc_lock_mode 2 (required for galera anyway)
              • innodb_checksum_algorithm crc32
              • innodb_purge_threads 4
              • innodb_strict_mode ON
              • innodb_log_file_size 128M
              • innodb_buffer_pool_dump_at_shutdown ON
              • innodb_buffer_pool_load_at_startup ON
              • innodb_buffer_pool_dump_pct 25 (Not currently implemented in mariadb)
              • innodb_file_format Barracuda
              • sync_binlog =1 ( or at most 10)
              • slave_net_timeout 60
              • performance schema - Enable events_statements_history and events_transactions_history consumers by default
              • mysql client prompt="\u@\h [\d] > "

              My additions:

              • skip-name-resolve (packages can enable on upgrade if host based usernames exist)
              • binlog_annotate_row_events ON
              • replicate_annotate_row_events ON
              • innodb_stats_traditional FALSE
              • use_stat_tables complementary
              • histogram_size 255
              • aria_recover QUICK,BACKUP
              • myisam-recover QUICK, BACKUP
              • table_definition_cache autosize to max(2000, 400+table_open_cache / 2) like 5.7
              • query_cache_strip_comments = ON

              If label=order-by-optimisations are resolved:

              • optimizer_switch = mrr=on,mrr_sort_keys=on,optimize_join_buffer_size=on
              • optimizer_use_condition_selectivity =4
              • join_cache_level = 8
              Show
              danblack Daniel Black added a comment - As pointed out on irc, sql_mode=STRICT_TRANS_TABLES would of helped prevent https://www.bugzilla.org/security/4.2.14/ . A major release is the only time to change these defaults. 10.2 is a long way off. So many of these values are already out of date addressing some would be a good start. So to give this issue some concrete values (from mysql-5.7 changes): sql_mode = ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_AUTO_CREATE_USER NO_ENGINE_SUBSTITUTION innodb_large_prefix = yes log_slow_admin_statements ON log_slow_slave_statements ON long-query-time 2 log-queries-not-using-indexes ON min-examined-row-limit 1000 group_concat_max_len 1M max_allowed_packet 16M binlog_format ROW (require for galera) innodb_autoinc_lock_mode 2 (required for galera anyway) innodb_checksum_algorithm crc32 innodb_purge_threads 4 innodb_strict_mode ON innodb_log_file_size 128M innodb_buffer_pool_dump_at_shutdown ON innodb_buffer_pool_load_at_startup ON innodb_buffer_pool_dump_pct 25 (Not currently implemented in mariadb) innodb_file_format Barracuda sync_binlog =1 ( or at most 10) slave_net_timeout 60 performance schema - Enable events_statements_history and events_transactions_history consumers by default mysql client prompt="\u@\h [\d] > " My additions: skip-name-resolve (packages can enable on upgrade if host based usernames exist) binlog_annotate_row_events ON replicate_annotate_row_events ON innodb_stats_traditional FALSE use_stat_tables complementary histogram_size 255 aria_recover QUICK,BACKUP myisam-recover QUICK, BACKUP table_definition_cache autosize to max(2000, 400+table_open_cache / 2) like 5.7 query_cache_strip_comments = ON If label=order-by-optimisations are resolved: optimizer_switch = mrr=on,mrr_sort_keys=on,optimize_join_buffer_size=on optimizer_use_condition_selectivity =4 join_cache_level = 8

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  mathnode Richard Bensley
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: