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

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

严少安 Lv.6
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 个参数。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- 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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- 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 相关设定。

1
2
3
4
5
6
7
8
9
10
11
-- 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
  • Title: IvorySQL 3.1 和 2.3 系统参数变化(上篇)
  • Author: 严少安
  • Created at: 2024-02-06 08:22:53
  • Updated at: 2024-02-06 08:22:53
  • Link: https://shawnyan.cn/2024/ivorysql/ivorysql-3.1-sys-vars-1/
  • License: This work is licensed under CC BY-NC-SA 4.0.
 Comments