mirror of
https://github.com/MariaDB/server.git
synced 2025-02-14 09:25:35 +01:00
![Marko Mäkelä](/assets/img/avatar_default.png)
Before commit6112853cda
in MySQL 4.1.1 introduced the parameter innodb_file_per_table, all InnoDB data was written to the InnoDB system tablespace (often named ibdata1). A serious design problem is that once the system tablespace has grown to some size, it cannot shrink even if the data inside it has been deleted. There are also other design problems, such as the server hang MDEV-29930 that should only be possible when using innodb_file_per_table=0 and innodb_undo_tablespaces=0 (storing both tables and undo logs in the InnoDB system tablespace). The parameter innodb_change_buffering was deprecated in commitb5852ffbee
. Starting with commitbaf276e6d4
(MDEV-19229) the number of innodb_undo_tablespaces can be increased, so that the undo logs can be moved out of the system tablespace of an existing installation. If all these things (tables, undo logs, and the change buffer) are removed from the InnoDB system tablespace, the only variable-size data structure inside it is the InnoDB data dictionary. DDL operations on .ibd files was optimized in commit86dc7b4d4c
(MDEV-24626). That should have removed any thinkable performance advantage of using innodb_file_per_table=0. Since there should be no benefit of setting innodb_file_per_table=0, the parameter should be deprecated. Starting with MySQL 5.6 and MariaDB Server 10.0, the default value is innodb_file_per_table=1.
77 lines
5.9 KiB
Text
77 lines
5.9 KiB
Text
set names utf8;
|
|
create database mysqltest1;
|
|
select database_name, table_name, length(table_name) from mysql.innodb_table_stats where database_name = 'mysqltest1';
|
|
database_name table_name length(table_name)
|
|
CREATE TABLE mysqltest1.test_jfg_table_name_with_64_chars_123456789012345678901234567890 (
|
|
id int(10) unsigned NOT NULL,
|
|
id2 int(10) unsigned NOT NULL,
|
|
PRIMARY KEY ( id, id2 )
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE ( id )
|
|
SUBPARTITION BY HASH ( id2 )
|
|
SUBPARTITIONS 2 (
|
|
PARTITION test_jfg_partition_name_with_60_chars_1234567890123456789012 VALUES LESS THAN (1000) ENGINE = InnoDB,
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB);
|
|
select database_name, table_name, length(table_name) from mysql.innodb_table_stats where database_name = 'mysqltest1';
|
|
database_name table_name length(table_name)
|
|
mysqltest1 test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#pmax#SP#pmaxsp0 82
|
|
mysqltest1 test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#pmax#SP#pmaxsp1 82
|
|
mysqltest1 test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#test_jfg_partition_name_with_60_chars_1234567890123456789012#SP#test_jfg_partition_name_with_60_chars_1234567890123456789012sp0 194
|
|
mysqltest1 test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#test_jfg_partition_name_with_60_chars_1234567890123456789012#SP#test_jfg_partition_name_with_60_chars_1234567890123456789012sp1 194
|
|
CREATE TABLE mysqltest1.éééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé (
|
|
id int(10) unsigned NOT NULL,
|
|
id2 int(10) unsigned NOT NULL,
|
|
PRIMARY KEY ( id, id2 )
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE ( id )
|
|
SUBPARTITION BY HASH ( id2 )
|
|
SUBPARTITIONS 2 (
|
|
PARTITION çççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç VALUES LESS THAN (1000) ENGINE = InnoDB,
|
|
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB);
|
|
ERROR HY000: The path specified for @0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@... is too long
|
|
SET @file_per_table=@@GLOBAL.innodb_file_per_table;
|
|
SET GLOBAL innodb_file_per_table=0;
|
|
Warnings:
|
|
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
|
|
CREATE TABLE mysqltest1.t1 (a INT) ENGINE=INNODB
|
|
PARTITION BY RANGE (a) SUBPARTITION BY HASH(a)
|
|
(PARTITION `$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$`
|
|
VALUES LESS THAN (10)
|
|
(SUBPARTITION
|
|
`--------------------------abcdef0123456789abcdef0123456789abcdef`,
|
|
SUBPARTITION
|
|
`0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`)
|
|
);
|
|
SET GLOBAL innodb_file_per_table=@file_per_table;
|
|
Warnings:
|
|
Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
|
|
SHOW CREATE TABLE mysqltest1.t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
|
PARTITION BY RANGE (`a`)
|
|
SUBPARTITION BY HASH (`a`)
|
|
(PARTITION `$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$` VALUES LESS THAN (10)
|
|
(SUBPARTITION `--------------------------abcdef0123456789abcdef0123456789abcdef` ENGINE = InnoDB,
|
|
SUBPARTITION `0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef` ENGINE = InnoDB))
|
|
INSERT INTO mysqltest1.t1 VALUES(1);
|
|
DROP TABLE mysqltest1.`#mysql50#t1#P#@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024#SP#0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`;
|
|
ERROR 42000: Incorrect table name '#mysql50#t1#P#@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@'
|
|
ALTER TABLE mysqltest1.t1 ADD FOREIGN KEY (a) REFERENCES
|
|
mysqltest1.test_jfg_table_name_with_64_chars_123456789012345678901234567890;
|
|
ERROR HY000: Partitioned tables do not support FOREIGN KEY
|
|
ALTER TABLE
|
|
mysqltest1.test_jfg_table_name_with_64_chars_123456789012345678901234567890
|
|
ADD FOREIGN KEY (a) REFERENCES mysqltest1.t1;
|
|
ERROR HY000: Partitioned tables do not support FOREIGN KEY
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
|
|
WHERE NAME LIKE 'mysqltest1%';
|
|
NAME
|
|
mysqltest1/t1#P#@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024#SP#0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
|
|
mysqltest1/t1#P#@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024@0024#SP#@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002d@002dabcdef0123456789abcdef0123456789abcdef
|
|
mysqltest1/test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#pmax#SP#pmaxsp0
|
|
mysqltest1/test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#pmax#SP#pmaxsp1
|
|
mysqltest1/test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#test_jfg_partition_name_with_60_chars_1234567890123456789012#SP#test_jfg_partition_name_with_60_chars_1234567890123456789012sp0
|
|
mysqltest1/test_jfg_table_name_with_64_chars_123456789012345678901234567890#P#test_jfg_partition_name_with_60_chars_1234567890123456789012#SP#test_jfg_partition_name_with_60_chars_1234567890123456789012sp1
|
|
drop database mysqltest1;
|