暂无图片
暂无图片
2
暂无图片
暂无图片
1
暂无图片

IvorySQL 3.1 和 2.3 系统参数变化(上篇)

原创 严少安 2024-02-06
315

ivorysql.png

前情回顾

IvorySQL 3.1 已经发版一段时间,前面写过几篇文章来介绍 IvorySQL。

从 IvorySQL 3.0 到 3.1 变化较小,没有系统参数变化,主要修复了各种八阿哥。
接下来将用两篇文章的篇幅介绍 IvorySQL 3.1 和 2.3 的参数区别。

系统参数变化(count)

视图 pg_settings 提供对服务器运行时参数的访问。 它本质上是 SHOWSET 命令的替代接口。它还提供对有关每个参数的一些事实的访问,这些事实不能从 SHOW 直接获得,例如最小值和最大值。

从 pg_settings 可以查询到当前版本数据库有多少个系统参数,以及设定值和默认值。

IvorySQL 2.3 共有 354 个参数,IvorySQL 3.1 共有 371 个参数。

-- 2.3 ivorysql=# select setting from pg_settings where name = 'server_version'; -[ RECORD 1 ]---------- setting | 15.3-ShawnYan ivorysql=# select count(*) from pg_settings; -[ RECORD 1 ] count | 354 -- 3.1 ivorysql=# select setting from pg_settings where name = 'server_version'; -[ RECORD 1 ]---------- setting | 16.1-ShawnYan ivorysql=# select count(*) from pg_settings; -[ RECORD 1 ] count | 371
复制

其中,有 6 个删减参数,2 个默认值变更参数,以及 23 个新增参数。

系统参数变化(remove)

1. compatible_mode

在之前的文章《象牙数据库 IvorySQL v2.3 特性浅析》中介绍过这个参数。

IvorySQL 中增加了配置项 compatible_mode 用于选择兼容 PostgreSQL 模式还是 Oracle 模式,默认值为 postgres

在 IvorySQL 3 中,该参数被 ivorysql.compatible_mode 取代。

2. force_parallel_mode

该参数用于强制开启并行查询,一般用于测试。从 IvorySQL 3 开始,更名为 debug_parallel_query

3. lc_collate

从 IvorySQL 3 开始,只读参数 lc_collatelc_ctype 被移除。

数据库之间的排序规则和区域设置可能有所不同,因此将它们作为只读服务器变量是没有帮助的。

除此之外,还在使用的 lc 参数还有: lc_messages, lc_monetary, lc_numeric, lc_time.

4. lc_ctype

同上。

5. promote_trigger_file

该参数意为指定触发器文件名称,该文件的存在将结束 standby 节点中的恢复。

用于将备用数据库升级为主数据库,现在使用 pg_ctl promotepg_promote() 可以更轻松地完成。

该参数在 PG 12 中,名称由 trigger_file 变更为 promote_trigger_file,在 IvorySQL 3 中被移除。

6. vacuum_defer_cleanup_age

该参数用于指定 VACUUM 和 HOT 更新在清除死亡行版本之前,应该推迟多久(以事务数量计)。默认为 0 个事务,死亡行版本将被尽可能快地清除。

可以在 standby 服务器上设定 hot_standby_feedback 和复制槽,该参数不再需要,在 IvorySQL 3 中被移除。

系统参数变化(modify)

有两个参数的默认值发生了变化。

1. nls_length_semantics

nls_length_semantics 参数用于设定字符串长度单位,

在 IvorySQL 2.3 中,默认值为 none,在 IvorySQL 3.1 中,默认值变更为 byte

-- 2.3 ivorysql=# select setting from pg_settings where name = 'server_version'; -[ RECORD 1 ]---------- setting | 15.3-ShawnYan ivorysql=# select setting, source from pg_settings where name = 'nls_length_semantics'; -[ RECORD 1 ]---- setting | none source | default -- 3.1 ivorysql=# select setting from pg_settings where name = 'server_version'; -[ RECORD 1 ]---------- setting | 16.1-ShawnYan ivorysql=# select setting, source from pg_settings where name = 'nls_length_semantics'; -[ RECORD 1 ]---- setting | byte source | default
复制

2. shared_preload_libraries

IvorySQL 3 中,对 Oracle 兼容模式的实现进行了重构,所以系统参数也发生了调整,该参数受此影响。

在 2.3 中为空,在 3.1 中有 ora 相关设定。

-- 2.3 ivorysql=# select setting, source from pg_settings where name = 'shared_preload_libraries'; -[ RECORD 1 ]---- setting | source | default -- 3.1 ivorysql=# select setting, source from pg_settings where name = 'shared_preload_libraries'; -[ RECORD 1 ]--------------------------- setting | liboracle_parser, ivorysql_ora source | configuration file
复制

小结

在对比 IvorySQL 3.1 和 2.3 的系统参数时,共发现 31 个变化点,本文介绍了 6 个删减参数,和 2 个默认值变更参数。

关于 23 个新增参数,且听下回分解。

logo.jpg

最后修改时间:2024-02-12 10:35:51
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

yBmZlQzJ
暂无图片
1年前
评论
暂无图片 0
文档testing-guide 19c /2.1 Capturing the SQL Workload中提到:SQL statements can be loaded into a SQL tuning set from different sources, including the cursor cache, Automatic Workload Repository (AWR), SQL trace files, and existing SQL tuning sets 详情 分享
1年前
暂无图片 点赞
评论