[MDEV-11940] Partition Selection (Prunning) in Aria: Horrible Performance Created: 2017-01-30  Updated: 2021-05-26  Resolved: 2021-05-26

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Storage Engine - Aria
Affects Version/s: 10.1.19, 10.1.20, 10.1.21
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Juan Telleria Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

Windows 7


Attachments: Microsoft Word MariaDB Partition Aria.xlsx     File my MariaDB Tornado24 Aria (6) + InnoDB (4).7z    

 Description   

After creating an Aria partitioned table with the following definition:

CREATE TABLE scada_data_processing.`t0_DISPOIN_imported_data`
	(
		`id_scada_data` INT unsigned NOT NULL AUTO_INCREMENT,
		`MachineID` VARCHAR(25),
		`SCADA_Code` INT NOT NULL DEFAULT '-2',
		`Description` VARCHAR(255) CHARACTER SET 'latin2' DEFAULT NULL ,
		`DateTimeON` DATETIME,
		`DateTimeOFF` DATETIME,
		`Time` TIME DEFAULT NULL,
		`Comment` VARCHAR(255) DEFAULT NULL,
		`IsAlarm` VARCHAR(255) DEFAULT NULL,
		`Open` VARCHAR(255) DEFAULT NULL,
		PRIMARY KEY(`id_scada_data`, `SCADA_Code`),
		INDEX (`MachineID`),
		INDEX(`SCADA_Code`),
		INDEX(`DateTimeON`),
		INDEX(`DateTimeOFF`)
	) 
		ENGINE=Aria
		CHARSET='utf8mb4'
                PARTITION BY RANGE (`SCADA_Code`)
        (
	  PARTITION p0_DismissedCodes VALUES LESS THAN (0),
          PARTITION p1_DownTime VALUES LESS THAN (4), 
          PARTITION p2_Operative VALUES LESS THAN (6), 
          PARTITION p3_DownTime VALUES LESS THAN (11), 
          PARTITION p4_SCADAData VALUES LESS THAN (2509),	
          PARTITION p5_NoCommunication VALUES LESS THAN (2510),	
          PARTITION p6_SCADAData VALUES LESS THAN MAXVALUE);

When I try to do explicit partition selection (Theoretically possible as indicates MariaDB documentation), the OPTIMIZER tells me when I execute the following code:

EXPLAIN PARTITIONS SELECT
   *
FROM
   scada_data_processing.`t0_DISPOIN_imported_data` 
   PARTITION (p4_SCADAData, p6_SCADAData);

That:

table partitions type
t0_DISPOIN_imported_data p4_SCADAData,p6_SCADAData ALL

Therefore, theorically only desired partitions are selected.

However, after performing the same INSERT INTO ... SELECT operation with InnoDB, MyISAM and Aria Engines (All engines perfectly configured), it took:

  • Nearly 13 [min] for Aria Engine.
  • 6 [min] to InnoDB Engine.
  • And 7,5 [min] to MyISAM.
    To perform the same statement.

Maybe this performance decrease could be due to the fact that when pruning is performed on a partitioned MyISAM table (or Aria), all partitions are opened, whether or not they are examined, due to the design of the MyISAM storage engine.

For Aria Engine It 13 [min] to perform the operation either using ROW_FORMAT = PAGE or ROW_FORMAT = DYNAMIC.

Thank you for your help.

Kind regards,
Juan



 Comments   
Comment by Elena Stepanova [ 2017-02-24 ]

How many rows are we talking about? How many total in the table, and how many are selected?
Could you please paste the full output of EXPLAIN PARTITIONS SELECT ... and EXPLAIN PARTITIONS INSERT ...?
Are you inserting into the same empty table every time?
Please also attach your cnf file(s).

Comment by Juan Telleria [ 2017-02-27 ]
  • 13.000.000 [Rows] for scada_data_processing.`t0_DISPOIN_imported_data` Table.
  • They are selected 6.000.000 [Rows] aprox.
  • It is only inserted once into the same table.
Comment by Juan Telleria [ 2017-02-27 ]

I'ver just attached EXPLAIN PARTITION changing the Engine from table "t0_DISPOIN_imported_data" from InnoDB to Aria, and viceversa.

Thank you

Comment by Elena Stepanova [ 2017-04-20 ]

Contents of xlsx file (EXPLAIN output):

EXPLAIN PARTITIONS INSERT INTO: Aria                                        
                                        
id    select_type    table    partitions    type    possible_keys    key    key_len    ref    rows    Extra
1    SIMPLE    A    p4_SCADAData,p6_SCADAData    ALL                    6040562    
1    SIMPLE    B        ref    MachineID    MachineID    28    scada_data_processing.A.MachineID    2    Using where
1    SIMPLE    C        eq_ref    PRIMARY    PRIMARY    27    scada_data_processing.B.MachineUT    1    Using where
1    SIMPLE    D        ref    Index_Envelope_and_AlarmCode,Index_ID_ENVELOPE,Index_SCADA_Code    Index_Envelope_and_AlarmCode    10    scada_data_processing.A.SCADA_Code,scada_data_processing.C.ID_ENVELOPE    1    Using where
                                        
EXPLAIN PARTITIONS SELECT: Aria                                        
                                        
id    select_type    table    partitions    type    possible_keys    key    key_len    ref    rows    Extra
1    SIMPLE    A    p4_SCADAData,p6_SCADAData    ALL                    6040562    
1    SIMPLE    B        ref    MachineID    MachineID    28    scada_data_processing.A.MachineID    2    Using where
1    SIMPLE    C        eq_ref    PRIMARY    PRIMARY    27    scada_data_processing.B.MachineUT    1    Using where
1    SIMPLE    D        ref    Index_Envelope_and_AlarmCode,Index_ID_ENVELOPE,Index_SCADA_Code    Index_Envelope_and_AlarmCode    10    scada_data_processing.A.SCADA_Code,scada_data_processing.C.ID_ENVELOPE    1    Using where

EXPLAIN PARTITIONS INSERT INTO: InnoDB                                        
                                        
id    select_type    table    partitions    type    possible_keys    key    key_len    ref    rows    Extra
1    SIMPLE    A    p4_SCADAData,p6_SCADAData    ALL                    5866044    
1    SIMPLE    B        ref    MachineID    MachineID    28    scada_data_processing.A.MachineID    2    Using where
1    SIMPLE    C        eq_ref    PRIMARY    PRIMARY    27    scada_data_processing.B.MachineUT    1    Using where
1    SIMPLE    D        ref    Index_Envelope_and_AlarmCode,Index_ID_ENVELOPE,Index_SCADA_Code    Index_Envelope_and_AlarmCode    10    scada_data_processing.A.SCADA_Code,scada_data_processing.C.ID_ENVELOPE    1    Using where
                                        
EXPLAIN PARTITIONS SELECT: InnoDB                                        
                                        
id    select_type    table    partitions    type    possible_keys    key    key_len    ref    rows    Extra
1    SIMPLE    A    p4_SCADAData,p6_SCADAData    ALL                    5866044    
1    SIMPLE    B        ref    MachineID    MachineID    28    scada_data_processing.A.MachineID    2    Using where
1    SIMPLE    C        eq_ref    PRIMARY    PRIMARY    27    scada_data_processing.B.MachineUT    1    Using where
1    SIMPLE    D        ref    Index_Envelope_and_AlarmCode,Index_ID_ENVELOPE,Index_SCADA_Code    Index_Envelope_and_AlarmCode    10    scada_data_processing.A.SCADA_Code,scada_data_processing.C.ID_ENVELOPE    1    Using where

Contents of 7z file (ini)

########################################################################
########################################################################
############# MARIADB: TORNADO24 CONFIGURATION FILE - ARIA #############
########################################################################
########################################################################
 
#########################################################################
############################# client ####################################
#########################################################################
 
# The following options will be passed to all MariaDB clients
[client]
port			= 3305
#socket			= /tmp/mysql.sock
socket          	= C:/Program Files/MariaDB 10.1/data/mysql.sock
pid-file        	= C:/Program Files/MariaDB 10.1/data/mysql.pid
default-character-set	= latin1
 
# Here follows entries for some specific programs
 
#########################################################################
############################ mariadb ####################################
#########################################################################
 
[mariadb]
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# |||||||||||||||||||||||||||||| GENERAL |||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
# The MariaDB server
[mysqld]
port		= 3305
#socket		= /tmp/mysql.sock
socket          = C:/Program Files/MariaDB 10.1/data/mysql.sock
pid-file        = C:/Program Files/MariaDB 10.1/data/mysql.pid
 
# Table type which is used by default when creating new tables, if not
# specified differently during the CREATE TABLE statement.
# The default storage engine that will be used when new tables are created.
 
default-storage-engine  = aria
 
# Default storage engine that will be used for tables created with 
# CREATE TEMPORARY TABLE (Whichever this Engine, Aria Engine will always
# be used for internal temporary tables, as materialized tables in subqueries,
# or other internal tables). InnoDB does not perform well for Temporary Tables,
# which require fast INSERT INTO...VALUES in Loops (For example: Cursors).
 
default_tmp_storage_engine = aria
 
# The default character set that will be used when a new schema or table is
# created and no character set is defined
 
character-set-server	= latin1
collation-server	= latin1_spanish_ci
 
# Set the SQL mode to strict
# Default: sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
 
sql_mode		= ""
 
# *************************** OTHER *********************************** #
 
group_concat_max_len	       = 4000
 
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||| DATA STORAGE |||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
# Path to the database root
 
datadir 	= C:/Program Files/MariaDB 10.1/data/
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# |||||||||||||||||||||||||||||| SAFETY ||||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
# The maximum size of a query packet the server can handle as well as
# maximum query size server can process (Important when working with
# large BLOBs).  enlarged dynamically, for each connection.
max_allowed_packet = 16M
 
# Maximum amount of errors allowed per host. If this limit is reached,
# the host will be blocked from connecting to the MariaDB server until
# "FLUSH HOSTS" has been run or the server was restarted. Invalid
# passwords and other errors during the connect phase result in
# increasing this value. See the "Aborted_connects" status variable for
# global counter.
max_connect_errors = 1000
 
# Secure File Priv.
# Disabled: secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/"
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# |||||||||||||||||||||||| CACHES AND LIMITS |||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
# Maximum size for internal (in-memory) temporary tables. If a table
# grows larger than this value, it is automatically converted to disk
# based table This limitation is for a single table. There can be many
# of them.
tmp_table_size = 512M
 
# Maximum allowed size for a single HEAP (in memory) table. This option
# is a protection against the accidential creation of a very large HEAP
# table which could otherwise use up all memory resources.
max_heap_table_size = 512M
 
# Query cache is used to cache SELECT results and later return them
# without actual executing the same query once again. Having the query
# cache enabled may result in significant speed improvements, if your
# have a lot of identical queries and rarely changing tables. See the
# "Qcache_lowmem_prunes" status variable to check if the current value
# is high enough for your load.
# Note: In case your tables change very often or if your queries are
# textually different every time, the query cache may result in a
# slowdown instead of a performance improvement.
 
query_cache_size = 1M
 
# How many threads we should keep in a cache for reuse. When a client
# disconnects, the client's threads are put in the cache if there aren't
# more than thread_cache_size threads from before.  This greatly reduces
# the amount of thread creations needed if you have a lot of new
# connections. (Normally this doesn't give a notable performance
# improvement if you have a good thread implementation.)
thread_cache_size = 256
 
# The maximum amount of concurrent sessions the MariaDB server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
 
# Low value choosen is order to reduce RAM Memory Allocation.
 
max_connections = 50
 
# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable "open-files-limit" in
# section [mysqld_safe]
 
table_open_cache = 4096
 
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||| LOGGING ||||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
# General and Slow logging.
 
log-output=FILE
general-log=0
general_log_file="NGALARRETA-P700.log"
 
# Error Logging.
 
log-error                      = C:/Program Files/MariaDB 10.1/data/NGALARRETA-P700-error.log
log-queries-not-using-indexes  = 0
slow-query-log                 = 0
slow-query-log-file            = C:/Program Files/MariaDB 10.1/data/NGALARRETA-P700-slow.log
 
long_query_time=10
 
# Binary Logging.
# log-bin
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||| ALL ENGINES ||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
# Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
# queries. If sorted data does not fit into the sort buffer, a disk
# based merge sort is used instead - See the "Sort_merge_passes"
# status variable. Allocated per thread if sort is needed.
 
# If you see many sort_merge_passes per second in SHOW GLOBAL STATUS 
# output, you can consider increasing the sort_buffer_size value to 
# speed up ORDER BY or GROUP BY operations that cannot be improved with
# query optimization or improved indexing.
 
# Commented for choosing default values.
 
sort_buffer_size = 256K
 
# This buffer is used for the optimization of full JOINs (JOINs without
# indexes). Such JOINs are very bad for performance in most cases
# anyway, but setting this variable to a large value reduces the
# performance impact. See the "Select_full_join" status variable for a
# count of full JOINs. Allocated per thread if full join is found
 
# The minimum size of the buffer that is used for plain index scans, range 
# index scans, and joins that do not use indexes and thus perform full 
# table scans.
 
# Commented for Default Value.
 
join_buffer_size = 256K
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# |||||||||||||||||||||||||||||| OTHERS ||||||||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
# back_log is the number of connections the operating system can keep in
# the listen queue, before the MariaDB connection manager thread has
# processed them. If you have a very high connection rate and experience
# "connection refused" errors, you might need to increase this value.
# Check your OS documentation for the maximum value of this parameter.
# Attempting to set back_log higher than your operating system limit
# will have no effect.
 
# You need to increase this only if you expect a large number of 
# connections in a short period of time.
 
back_log = 150
 
# Only cache result sets that are smaller than this limit. This is to
# protect the query cache of a very large result set overwriting all
# other query results.
query_cache_limit = 2M
 
# Minimum word length to be indexed by the full text search index.
# You might wish to decrease it if you need to search for shorter words.
# Note that you need to rebuild your FULLTEXT index, after you have
# modified this value.
ft_min_word_len = 3
 
# Thread stack size to use. This amount of memory is always reserved at
# connection time. MariaDB itself usually needs no more than 64K of
# memory, while if you use your own stack hungry UDF functions or your
# OS requires more stack for some operations, you might need to set this
# to a higher value.
thread_stack = 297K
 
# Set the default transaction isolation level. Levels available are:
# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
 
# This variable's name might change to tx_isolation in future versions
# of MariaDB
 
transaction-isolation = REPEATABLE-READ
 
# Set the query cache type. 0 for OFF, 1 for ON and 2 for DEMAND.
query_cache_type=0
 
# The number of table definitions (from .frm files) that can be stored
# in the definition cache. If you use a large number of tables, you can
# create a large table definition cache to speed up opening of tables.
# The table definition cache takes less space and does not use file
# descriptors, unlike the normal table cache.
# The minimum and default values are both 400.
 
table_definition_cache=1400
 
# If the value of this variable is greater than 0, a replication slave
# synchronizes its master.info file to disk.
# (using fdatasync()) after every sync_master_info events.
sync_master_info=10000
 
# If the value of this variable is greater than 0, the MySQL server 
# synchronizes its relay log to disk.
# (using fdatasync()) after every sync_relay_log writes to the relay log.
sync_relay_log=10000
 
# If the value of this variable is greater than 0, a replication 
# slave synchronizes its relay-log.info file to disk.
# (using fdatasync()) after every sync_relay_log_info transactions.
sync_relay_log_info=10000
 
#########################################################################
########################## REPLICATION ##################################
#########################################################################
 
# Server Id.
# Used to identify master and slave servers in replication. The server_id
# must be unique for each server in the replicating group. If left at 0,
# the default, a slave will not connect to a master, and a master will
# refuse all slave connections.
# server_id=0
 
# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
#
# binary logging format - mixed recommended 
#binlog_format=mixed
 
# ***  Replication related settings 
 
# Unique server identification number between 1 and 2^32-1. This value
# is required for both master and slave hosts. It defaults to 1 if
# "master-host" is not set, but will MariaDB will not function as a master
# if it is omitted.
# server-id = 1
#
# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    changes in this file to the variable values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# Make the slave read-only. Only users with the SUPER privilege and the
# replication slave thread will be able to modify data on it. You can
# use this to ensure that no applications will accidently modify data on
# the slave instead of the master
#read_only
 
#########################################################################
###################### innodb (Secondary Engine) ########################
#########################################################################
 
# *********************** INNODB Specific options ********************* #
 
# Use this option if you have a MariaDB server with InnoDB support enabled
# but you do not plan to use it. This will save memory and disk space
# and speed up some things.
# skip-innodb
 
# Additional memory pool that is used by InnoDB to store metadata
# information.  If InnoDB requires more memory for this purpose it will
# start to allocate it from the OS.  As this is fast enough on most
# recent operating systems, you normally do not need to change this
# value. SHOW INNODB STATUS will display the current amount used.
innodb_additional_mem_pool_size = 20M
 
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system.  Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
 
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
 
innodb_buffer_pool_size = 4G
 
# InnoDB stores data in one or more data files forming the tablespace.
# If you have a single logical drive for your data, a single
# autoextending file would be good enough. In other cases, a single file
# per device is often a good choice. You can configure InnoDB to use raw
# disk partitions as well - please refer to the manual for more info
# about this.
innodb_data_file_path = ibdata1:12M:autoextend
 
# Set this option if you would like the InnoDB tablespace files to be
# stored in another location. By default this is the MariaDB datadir.
# Default Value: The MariaDB data directory
 
# innodb_data_home_dir = C:\\mysql\\data\\
 
# Number of IO threads to use for async IO operations. This value is
# hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a
# larger number.
innodb_write_io_threads = 4
innodb_read_io_threads = 4
 
# If you run into InnoDB tablespace corruption, setting this to a nonzero
# value will likely help you to dump your tables. Start from value 1 and
# increase it until you're able to dump the table successfully.
# Default Value: innodb_force_recovery=0
 
innodb_force_recovery=0
 
# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
 
# A setting of 0, the default, permits as many threads as necessary.
 
# Default Value: 0
 
# The number of Logical Processors x2 + 1 Hard Drive.
 
innodb_thread_concurrency = 49
 
# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit = 1
 
# Speed up InnoDB shutdown. This will disable InnoDB to do a full purge
# and insert buffer merge on shutdown. It may increase shutdown time a
# lot, but InnoDB will have to do it on the next startup instead.
innodb_fast_shutdown = 1
 
# The size of the buffer InnoDB uses for buffering log data. As soon as
# it is full, InnoDB will have to flush it to disk. As it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions). 
innodb_log_buffer_size = 16M
 
# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size = 2G
 
# Total number of files in the log group. A value of 2-3 is usually good
# enough.
innodb_log_files_in_group = 3
 
# Location of the InnoDB log files. Default is the MariaDB datadir. You
# may wish to point it to a dedicated hard drive or a RAID1 volume for
# improved performance
# Default (If none specified): Data Directory.
 
# innodb_log_group_home_dir = C:\\mysql\\data\\
 
# Maximum allowed percentage of dirty pages in the InnoDB buffer pool.
# If it is reached, InnoDB will start flushing them out agressively to
# not run out of clean pages at all. This is a soft limit, not
# guaranteed to be held.
innodb_max_dirty_pages_pct = 90
 
# How long an InnoDB transaction should wait for a lock to be granted
# before being rolled back. InnoDB automatically detects transaction
# deadlocks in its own lock table and rolls back the transaction. If you
# use the LOCK TABLES command, or other transaction-safe storage engines
# than InnoDB in the same transaction, then a deadlock may arise which
# InnoDB cannot notice. In cases like this the timeout is useful to
# resolve the situation.
innodb_lock_wait_timeout = 120
 
# The increment size (in MB) for extending the size of an auto-extend 
# InnoDB system tablespace file when it becomes full.
innodb_autoextend_increment=64
 
# The number of regions that the InnoDB buffer pool is divided into.
# For systems with buffer pools in the multi-gigabyte range, dividing the 
# buffer pool into separate instances can improve concurrency,
# by reducing contention as different threads read and write to cached 
# pages.
 
# Si dividimos innodb_buffer_pool_size / innodb_buffer_pool_instances nos
# deben de quedar paquetes de no menos de 1 [Gigabyte].
 
innodb_buffer_pool_instances=10
 
# Determines the number of threads that can enter InnoDB concurrently.
innodb_concurrency_tickets=5000
 
# Specifies how long in milliseconds (ms) a block inserted into the old 
# sublist must stay there after its first access before it can be moved
# to the new sublist.
 
innodb_old_blocks_time=1000
 
# It specifies the maximum number of .ibd files that MySQL can keep open
# at one time. The minimum value is 10.
innodb_open_files=300
 
# When this variable is enabled, InnoDB updates statistics during metadata 
# statements.
innodb_stats_on_metadata=0
 
# When innodb_file_per_table is enabled (the default in 5.6.6 and higher),
# InnoDB stores the data and indexes for each newly created table
# in a separate .ibd file, rather than in the system tablespace.
innodb_file_per_table=1
 
# Use the following list of values: 0 for crc32, 1 for strict_crc32, 
# 2 for innodb, 3 for strict_innodb, 4 for none, 5 for strict_none.
innodb_checksum_algorithm=0
 
# If this is set to a nonzero value, all tables are closed every flush_time
# seconds to free up resources and synchronize unflushed data to disk.
# This option is best used only on systems with minimal resources.
flush_time=0
 
#########################################################################
###################### myisam ("Disabled" Engine) ####################### 
#########################################################################
 
# If set, external locking for MyISAM tables is disabled.
# skip_external_locking = 1
 
# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
 
# If you don't use MyISAM tables explicitly you can set key_buffer_size
# to a very low value, 64K for example.
 
# 32 [GB] (Tornado24 Half RAM)� 0,25 = 8[GB]
 
key_buffer_size = 64K
 
# This buffer is allocated when MariaDB needs to rebuild the index in
# REPAIR, OPTIMIZE, ALTER table statements as well as in LOAD DATA INFILE
# into an empty table. It is allocated per thread so be careful with
# large settings.
# myisam_sort_buffer_size = 128M
 
# The maximum size of the temporary file MariaDB is allowed to use while
# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
# If the file-size would be bigger than this, the index will be created
# through the key cache (which is slower).
# myisam_max_sort_file_size = 50G
 
# If a table has more than one index, MyISAM can use more than one
# thread to repair them by sorting in parallel. This makes sense if you
# have multiple CPUs and plenty of memory.
# myisam_repair_threads = 6
 
# Automatically check and repair not properly closed MyISAM tables.
# myisam_recover_options = FORCE,BACKUP
 
# When reading rows in sorted order after a sort, the rows are read
# through this buffer to avoid disk seeks. You can improve ORDER BY
# performance a lot, if set this to a high value.
# Allocated per thread, when needed.
# read_rnd_buffer_size = 265K
 
#########################################################################
################# MyISAM & Aria System Variables ######################## 
#########################################################################
 
# Values in [MB] range turn out into a performance decrease
 
# Size of the buffer used for doing full table scans.
# Allocated per thread, if a full scan is needed.
read_buffer_size = 256K
 
# MyISAM uses special tree-like cache to make bulk inserts (that is,
# INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA
# INFILE) faster. This variable limits the size of the cache tree in
# bytes per thread. Setting it to 0 will disable this optimisation.  Do
# not set it larger than "key_buffer_size" for optimal performance.
# This buffer is allocated when a bulk insert is detected.
 
# Values of 1/4 key_buffer_size make sense (Percona). It is per connection,
# so a 1/16 ratio is choosen in order not to use excesive resources:
# 8[GB] (key_buffer_size) / 16 = 512[MB] (bulk_insert_buffer_size)
# Same value has been choosen as tmp_table_size (For those cases in which
# Temporary Tables exceed 512M and use MyISAM instead of Memory Engine).
 
# MyISAM uses a special tree-like cache to make bulk
# inserts faster for INSERT ... SELECT, INSERT ...
# VALUES (...), (...), ..., and LOAD DATA INFILE when
# adding data to NON-EMPTY TABLES.
# limits the size of the cache tree in bytes per thread.
 
bulk_insert_buffer_size=256M
 
#########################################################################
################## Aria System Variables (Main Engine) ##################
#########################################################################
 
# The maximum size of the temporary file MariaDB is allowed to use while
# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
# If the file-size would be bigger than this, the index will be created
# through the key cache (which is slower).
 
aria_max_sort_file_size = 50G
 
# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
 
aria_pagecache_buffer_size = 6G
 
# If a table has more than one index, MyISAM can use more than one
# thread to repair them by sorting in parallel. This makes sense if you
# have multiple CPUs and plenty of memory.
 
aria_repair_threads = 49
 
# This buffer is allocated when MariaDB needs to rebuild the index in
# REPAIR, OPTIMIZE, ALTER table statements as well as in LOAD DATA INFILE
# into an empty table. It is allocated per thread so be careful with
# large settings.
 
aria_sort_buffer_size = 128M
 
# Automatically check and repair not properly closed MyISAM tables.
# In MariaDB 10.2.0 aria_recover is renamed to aria_recover_options.
 
aria_recover = FORCE,BACKUP
 
 
#########################################################################
########################### mysqldump ###################################
#########################################################################
 
[mysqldump]
# Do not buffer the whole result set in memory before writing it to
# file. Required for dumping very large tables quick
 
quick
 
# The maximum size of one packet or any generated or intermediate string, 
# or any parameter sent by the mysql_stmt_send_long_data() C API function.
 
max_allowed_packet = 16M
 
#########################################################################
############################# mysql #####################################
#########################################################################
 
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
# sql_safe_updates = 0
 
#########################################################################
############################## mysqld_safe ##############################
#########################################################################
 
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
# |||||||||||||||||||||||| CACHES AND LIMITS |||||||||||||||||||||||||| #
# ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
 
[mysqld_safe]
# Increase the amount of open files allowed per process. Warning: Make
# sure you have set the global system limit high enough! The high value
# is required for a large number of opened tables
 
# Changes the number of file descriptors available to mysqld.
# You should try increasing the value of this option if mysqld gives you
#  the error "Too many open files".
# Default Value: Autosized
 
# open_files_limit 	= 65535
 
# Number of table definitions that can be cached.
 
table_definition_cache 	= 4096
 
 
#########################################################################
############################## myisamchk ################################
#########################################################################
 
[myisamchk]
 
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
 
#########################################################################
############################## mysqlhotcopy #############################
#########################################################################
 
[mysqlhotcopy]
interactive-timeout
 
#########################################################################
############################ mysqld #####################################
#########################################################################
 
[mysqld]
 
character-set-server	= latin1
collation-server	= latin1_spanish_ci

Comment by Elena Stepanova [ 2021-04-28 ]

There has been a variety of Aria-related changes in MariaDB 10.5. Is the problem still reproducible there?

Generated at Thu Feb 08 07:53:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.