Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
There are several size-related system variables that can be changed dynamically. e.g.:
- innodb_log_file_size
- innodb_buffer_pool_size
- max_heap_table_size
- tmp_table_size
- tmp_disk_table_size
- binlog_cache_size
- binlog_file_cache_size
- binlog_stmt_cache_size
- etc.
In configuration files, users are able to set these variables using SI prefixes. e.g.:
[mariadb]
|
innodb_log_file_size=2G
|
It would be great if users could do the same thing with SET:
SET GLOBAL innodb_log_file_size='2G'; |
Currently, users would have to do this instead:
SET GLOBAL innodb_log_file_size=(2 * 1024 * 1024 * 1024); |
Can we implement SI prefixes for SET?
Attachments
Issue Links
- relates to
-
MDEV-26400 ALTER TABLE does not remove KEY_BLOCK_SIZE for non-Compressed InnoDB tables
-
- Stalled
-
-
MDEV-27158 Humanize the number of bytes in InnoDB messages
-
- Closed
-
The International System of Units (Système international) defines metric prefixes of the unit of measurement. The unit of measurement is customarily attached as a suffix, i.e., 123 km.
A unit of byte (customarily, an octet of binary digits) is not defined in SI, and the prefixes that were suggested are not actually metric (powers of one thousand) but binary (powers of 2¹⁰ = 1,024).
If we did not already support prefixes in the configuration file parser, we might want to define Ki, Mi, Gi, Ti as powers of 1024, and k,M,G,T as powers of 1000. (Yes, the lower-case k in SI is the prefix for kilo (one thousand), and the upper-case K is for Kelvin, the absolute temperature.)
I think that to remain compatible with the configuration file parser and the case-insensitive nature of SQL, we had better use case-insensitive interpretation, and use the case-insensitive suffixes K,M,G,T defined as powers of 1,024. That is,
would set the number to 1024. Note: in the above example, the parameter does not refer to bytes, but to innodb_page_size×(1+innodb_doublewrite).
Should we also allow the following?
History: InnoDB hijacked the KEY_BLOCK_SIZE attribute for the fixed compressed page size. The values 1,2,4,8,16 are allowed. We did not use 1024,2048,4096,8192,16384 because it was thought that it is inconvenient for users to type such long numbers.