Mariadb 10.2
2021-03-17 13:46:23 0 举报
AI智能生成
登录查看完整内容
Mariadb 10.2功能预览
作者其他创作
大纲/内容
Mariadb 10.2
XtraDB替换为InnoDB
开窗函数
Window functions have been introduced.引入开窗函数,语法:function (expression) OVER ( [ PARTITION BY expression_list ] [ ORDER BY order_list [ frame_clause ] ] ) ,例如:涉及到数据的维度分组(或不分组)之后的函数(比如排序RANK\\平均值AVG\\中位数MEDIAN等)计算。
SHOW CREATE USER语法支持
The SHOW CREATE USER statement was introduced增加语法支持,查询用户创建信息。SHOW CREATE USER statement
用户资源限制
New CREATE USER options for limiting resource usage and tls/ssl创建用户,可以限制资源使用(比如限制每小时查询量、更新量、链接量等),可以增加特定证书TLS。
ALTER USER语法支持
New ALTER USER statement增加语法支持,可以修改用户信息。ALTER USER statement
CTE语法支持
Non-recursive Common Table Expressions增加语法支持,非递归公用表达式CTE结构支持。
Recursive Common Table Expressions增加语法支持,递归公用表达式CTE结构支持,即可以在CTE中引用自身。
强制约束检查
Support for CHECK CONSTRAINT 从MariaDB 10.2.1开始,强制执行约束。在MariaDB 10.2.1之前,约束表达式在语法中已接受但被忽略
大数据类型支持默认值
Support for DEFAULT with expressionsBLOB和TEXT列现在支持DEFAULT。DEFAULT子句现在可以与表达式或函数一起使用。
虚拟计算列功能增强
Lots of restrictions lifted for Virtual computed columns虚拟计算列增加相关功能支持,包括:支持所有数据类型,去掉AUTO_INCREMENT自增选项,支持虚拟列上的索引,支持内置函数,支持用户自定义函数等。
DECIMAL类型小数位增大
Number of supported decimals in DECIMAL has increased from 30 to 38DECIMAL中支持的小数位数从30增加到38,Oracle兼容性。
新增List分区表
Added catchall for list partitionsLIST分区表,一个分区表达式(一个列,或者稍微复杂一些的计算),然后使用它来确定哪些分区将包含每一行。之前是RANGE分区表
EXEC语法支持
Oracle-style EXECUTE IMMEDIATE statement Oracle语法兼容,EXECUTE IMMEDIATE statement。例如:EXECUTE IMMEDIATE 'SELECT 1' ;mysql中其实也有对应的动态SQL解析:prepare stmt from \"select 1\";execute stmt;deallocate prepare stmt;注意EXECUTE和prepare类型,不能在function函数和trigger触发器中运行,只能在PROCEDURE存储过程中运行。
PREPARE更智能
优化InnoDB故障报告
Better InnoDB crash recovery progress reporting 优化InnoDB故障恢复进度报告
优化InnoDB启动和关闭
Improvements to InnoDB startup/shutdown to make it more robust优化InnoDB的启动/关闭功能
SQl_MODE默认值修改
binlog_checksum默认修改
Replication from legacy MySQL servers may require setting binlog_checksum to NONE.从旧版本mysql复制需要修改binlog_checksum为NONE。注意:binlog_checksum在mariadb10.2.1之后默认值为CRC32,mariadb10.2.0之前默认值为NONE。
同事件多触发器支持
Multiple triggers for the same event单表的同一个事件可以增加多个触发器了。
The FOLLOWS/PRECEDES clauses have been added to the CREATE TRIGGER statement在创建多个触发器的时候,可以使用FOLLOWS或者PRECEDES指定触发器执行顺序。
Multiple triggers are now counted in the Executed_triggers status variable系统状态Executed_triggers可以显示多个触发器了。show status like 'Executed_triggers';
触发器可查看创建时间
SHOW TRIGGERS and SHOW CREATE TRIGGER now include the date and time the trigger was created可以显示触发器创建时间。
闪回支持
DML_only flashback can rollback instances/databases/tables to an old snapshotDML(INSERT\\DELETE\\UPDATE)语句支持闪回。注意:需要保证binlog_format=ROW,binlog_row_image=FULL
从库同步限制
从库延迟限制
Delayed replication is supported支持指定的从库在指定的时间量(以秒为单位)落后于主库。
binlog压缩
annotate_row行注释
Default value of replicate_annotate_row_events changed to ON相关系统参数binlog_annotate_row_events,replicate_annotate_row_events默认值设置为ON。注意:annotate_row行注释,用于把原始SQL执行语句以注释的形式记录到binlog日志中。
从库自动重连
Default value of slave_net_timeout reduced to 60 seconds 从库断开连接之后,多长时间(以秒为单位)会尝试重新连接。默认值改为60,原来是3600
JSON类型及函数支持
The JSON data type (an alias for LONGTEXT) was introduced引入JSON数据类型。注意:MySQL中json类型以紧凑形式存储JSON对象,而不是像MariaDB中那样存储为LONGTEXT。这意味着基于行的复制将不适用于从MySQL到MariaDB的JSON类型。
Implement ST_AsGeoJSON and ST_GeomFromGeoJSON functions so the spatial features can be imported/exported using GeoJSON format添加了GeoJSON函数,便于GeoJSON格式导入导出空间类型。
用户变量插件
EXPLAIN优化
EXPLAIN FORMAT=JSON now shows outer_ref_condition field which contains the condition that the(?) SELECT checks on each re-executionEXPLAIN FORMAT=JSON 现在会在 outer_ref_condition 列显示每次循环匹配时SELECT检查的条件
EXPLAN FORMAT=JSON now shows sort_key field which shows the sort criteria used by filesort operation.EXPLAN FORMAT=JSON 现在会在 sort_key 列回显示filesort操作使用的排序规则
Connection优化
Connection setup was made faster by moving creation of THD to new thread设置连接更快了,因为把THD创建的工作挪到了新创建的线程中,之前是管理所有连接的那个线程来统一创建THD
条件下推
ANALYZE TABLE优化
ANALYZE TABLE has been re-implemented so as not to lock the entire table when collecting engine independent statistics ANALYZE TABLE 的代码重构了,在收集引擎无关的统计信息时并不需要锁住整个表
Table cache优化
Table cache can automatically partition itself as needed to reduce the contentionTable cache 可以自动分区来减少冲突
死锁检测可关闭
New variable to disable deadlock detection innodb_deadlock_detect可以关闭死锁检测新变量 innodb_deadlock_detect。注意:默认情况下,InnoDB死锁检测器处于启用状态。如果设置为off,将禁用死锁检测,MariaDB将改为依赖innodb_lock_wait_timeout。在具有高并发性的系统中,这可能会更有效,因为当多个线程必须等待相同的锁时,死锁检测可能会导致瓶颈。
伪造版本号
The server version can now be faked to work around dated applications that require a particular version string服务器版本可以随便伪造一个字串,因为有的应用会检查版本号
线程池优化
The thread pool now gives higher priority to connections that have an active transaction. This can be controlled with the new thread_pool_prio_kickup_timer and thread_pool_priority system variables.线程池现在可以给有活跃事务的连接更高的优先级。这可以通过新的 thread_pool_prio_kickup_timer 和 thread_pool_priority 变量来控制
group_concat()长度优化
Default value of group_concat_max_len changed to 1Mgroup_concat_max_len 的默认值改为 1048576 (1M) ,原来是1024 (1K),标识GROUP_CONCAT()函数的返回结果的最大长度(以字节为单位)
mysqlbinlog连续备份支持
Continuous binary log backup has been added to mysqlbinlogmysqlbinlog 增加了连续Binlog备份支持,利用–stop-never变量,可以一直等待新的日志
InnoDB的自增优化
Persistent AUTO_INCREMENT for InnoDB 在InnoDB持久化 AUTO_INCREMENT
支持重置会话
Support COM_RESET_CONNECTION支持 COM_RESET_CONNECTION:重置会话状态;比COM_CHANGE_USER它不会关闭并重新打开连接,并且不会重新进行身份验证,它更轻便
innodb_fast_shutdown不再需要
Upgrading to a new major release no longer requires setting innodb_fast_shutdown to 0. Omitting it can make the upgrade process a lot faster.升级到一个新的主要版本不再需要将innodb_fast_shutdown设置为0。忽略它可以使升级过程更快。
MariaDB兼容
MariaDB now works when started with a MySQL 5.7.6+ data directory MariaDB可以支持高于MySQL 5.7.6 版本的启动。
其他
存储引擎
MyRocks storage engine addedMyRocks存储引擎,基于LSM架构,提供更高的压缩率和更快的写入。
Zipped File Tables for the CONNECT storage engine CONNECT引擎支持ZIP压缩文件的表
The CONNECT engine now supports the JDBC Table type CONNECT引擎目前支持JDBC表类型
InnoDB
InnoDB tables now support spatial indexesinnodb表可以支持空间索引。
Default value of innodb_log_compressed_pages changed to ON from MariaDB 10.1.2 to MariaDB 10.1.25innodb_log_compressed_pages 默认值改为ON,是否将重新压缩的页面的图像存储在InnoDB Redo Log中
Default value of innodb_use_atomic_writes and innodb_use_trim changed to ONinnodb_use_atomic_writes 和innodb_use_trim 修改 默认值改为ON。innodb_use_atomic_writes在支持的SSD设备上实现原子写入。innodb_use_trim,InnoDB页面压缩:使用稀疏文件节省存储空间。
The unused innodb_api_* variables have been removed 没用的 innodb_api_* 变量被删除了
密码验证
ed25519 authentication plugined25519身份认证插件,最先发布于MariaDB 10.1.22 and MariaDB 10.2.5
Added support for OpenSSL 1.1 and LibreSSL添加 OpenSSL 1.1 和 LibreSSL 的支持
原子写入
Atomic writes support made more general. Shannon system SSD cards are now supported部分Shannon SSD设备上支持原子写入(在操作系统崩溃或断电时,给定的写操作全部完成,而不是部分完成)。
保留关键字
CRC32
Internal CRC32 routines use the optimized implementation on Power8内部 CRC32 函数在Power8下进行了优化。
字符集
0 条评论
回复 删除
下一页