本文将会记录Hologres每个版本中的默认行为变更。
V1.1版本默认行为变更说明(2022年04月)
内存优化
Hologres从 V1.1.53版本开始,针对内存进行优化,优化后端运维指标的汇报,相比之前版本常驻内存更少,从而提高计算使用内存。若有需要可以升级至Hologres V1.1.53版本。
V1.1版本默认行为变更说明(2022年03月)
Fixed Plan点查场景优化
Hologres从 V1.1.49版本开始,针对Fixed Plan点查场景进行了优化,在大规模点查的情况下提升了30%以上的吞吐。若有需要请升级Hologres实例至 V1.1.49及以上版本,Fixed Plan使用详情请参见Fixed Plan加速SQL执行。
V1.1版本默认行为变更说明(2022年03月)
分区子表绑定父表进行属性检测
Hologres从 V1.1.42版本开始,对分区子表绑定(ATTACH)父表时,将会进行更严格的属性检测,包括主键(PK)、索引、非空约束等,如果子表的属性与父表不一致,则会报错无法绑定。请在建表前确保分区子表的属性与父表一致,关于分区子表和父表的约束请参见CREATE PARTITION TABLE。
--假设已有父表和其子表,其DDL如下:
BEGIN;
CREATE TABLE public.hologres_parent(
a int,
b text not null,
c timestamptz not null,
ds text,
PRIMARY KEY(a,ds)
)
PARTITION BY LIST(ds);
CALL set_table_property('public.hologres_parent', 'orientation', 'column');
CALL set_table_property('public.hologres_parent', 'distribution_key', 'a');
CALL set_table_property('public.hologres_parent', 'clustering_key', 'b');
CALL set_table_property('public.hologres_parent', 'event_time_column', 'c');
CREATE TABLE public.hologres_child PARTITION OF public.hologres_parent FOR VALUES IN('20201103');
COMMIT;
--创建临时分区子表
BEGIN;
CREATE TABLE IF NOT EXISTS public.tmp_hologres_child(
a int,
b text not null,
c timestamptz not null,
ds text,
PRIMARY KEY (a,ds)
) ;
CALL set_table_property('public.tmp_hologres_child', 'orientation', 'column');
CALL set_table_property('public.tmp_hologres_child', 'distribution_key', 'a');
CALL set_table_property('public.tmp_hologres_child', 'clustering_key', 'a,b');
CALL set_table_property('public.tmp_hologres_child', 'event_time_column', 'c');
COMMIT;
--导入外表数据至临时分区子表
insert into public.tmp_hologres_child select * from foreign_table where ds='20201103';
--删除原分区子表,并将临时分区子表绑定至父表上
BEGIN;
DROP TABLE IF EXISTS public.hologres_child;
ALTER TABLE public.tmp_hologres_child RENAME TO hologres_child;
ALTER TABLE public.hologres_parent ATTACH PARTITION public.hologres_child
FOR VALUES IN ('20201103');
COMMIT ;
--错误原因
ERROR: partition index hologres_child's immutable properties(e.g. clustering_key, event_time_column) is consistent with parent.
Hint: create partition with [create table ... partition of ...] to be consistent with parent.
V1.1版本默认行为变更说明(2021年12月)
新建实例公网Endpoint默认关闭
出于数据访问控制的安全要求,自2021年12月7日00:00:00起,新建实例的公网Endpoint默认关闭,默认不提供公网访问能力。如果您需要使用公网Endpoint连接Hologres,请在Hologres管理控制台手动打开。
V1.1版本默认行为变更说明(2021年11月)
单节点计算内存上限取消20GB限制
V1.1版本默认行为变更说明(2021年10月)
- Auto Analyze默认打开
Auto Analyze在Hologres V0.10版本透出,经过多用户线上验证,具备生产可用状态,因此在Hologres V1.1版本中默认行为由关闭改为打开。升级实例不受影响,新创建实例默认为打开,同时相关参数名调整如下。关于Auto Analyze的使用请参见ANALYZE和AUTO ANALYZE。
原参数名 新参数名 默认值 hg_experimental_enable_start_auto_analyze_worker hg_enable_start_auto_analyze_worker on - Table Group相关函数更名
Resharding函数在Hologres V0.10版本透出,经过多用户线上验证,具备生产可用状态,在Hologres V1.1版本中相关函数名称调整如下。
原函数名 新函数名 hg_update_table_shard_count('table_name','table_group_name') hg_move_table_to_table_group('table_name','table_group_name') - 关于Resharding的使用请参见Table Group与Shard Count操作指南。
- 关于Table Group的使用,请参见Table Group设置最佳实践。
- MaxCompute外表访问行为变更
在Hologres V0.10版本中,Hologres具备了全新的MaxCompute外表加速查询引擎,带来30%以上的性能提升,经过多用户线上验证,具备生产可用状态,因此新版本使用新的查询引擎查询MaxCompute外表。升级用户不受影响,新创建实例默认使用全新外表引擎。同时相关参数名调整如下。有关参数的含义,请参见优化MaxCompute外部表的查询性能。
原参数名 新参数名 备注 hg_experimental_enable_access_odps_orc_via_holo hg_enable_access_odps_orc_via_holo 默认值为on。 hg_experimental_foreign_table_executor_max_dop hg_foreign_table_executor_max_dop 默认值调整为与实例Core数相同,最大为128。 无 hg_foreign_table_executor_dml_max_dop V1.1版本新增,默认为32,针对涉及有外表的DML SQL生效。 hg_experimental_foreign_table_split_size hg_foreign_table_split_size 默认值为64MB。 hg_experimental_foreign_table_max_partition_limit hg_foreign_table_max_partition_limit 默认为512,即一次Query查询扫描最大分区为512。 hg_experimental_enable_write_maxcompute 无 V1.1版本默认为on,即默认可回写至MaxCompute,详情请参见通过SQL导出数据至MaxCompute。 - pg_stat_activity表支持全局状态
在Hologres V1.1之前版本中,pg_stat_activity表只记录单个接入节点(FE)的活跃连接状态,对于活跃查询的检查和处理并不方便,在1.1版本中,pg_stat_activity包含了全部接入节点的状态,有关pg_stat_activity活跃查询的管理,请参见Query管理。
- 连接数默认行为更改
从Hologres V1.1版本开始,优化连接数默认行为,增加Superuser预留连接数,同时也优化HoloWeb连接池逻辑,强保证当连接数超过实例默认规格后,可以通过HoloWeb连接实例进行连接数管控和连接释放。关于连接数的使用请参见连接数管理。
- 修改idle_in_transaction_session_timeout默认参数值
参数
idle_in_transaction_session_timeout
描述了事务进入idle状态后的超时行为,如果不设置参数值,默认不会做事务超时的释放,容易发生查询被锁死的情况。在Hologres V1.1版本中,idle_in_transaction_session_timeout
值默认设置为10分钟。关于参数的使用,请参见Query管理。 - 同一个事务(Transaction)内不支持数据DML和DDL同时出现
Hologres只支持对DDL语句提供Transaction支持,如果在Transaction里包含了DML语句,会消耗事务资源,引起更多潜在不稳定状态。因此在Hologres V1.1版本中,如果将DML与DDL同时写在一个Transaction里,会有错误提示:
insert in ddl transaction is not supported now
,如以下SQL语句。begin; create table abc(id int); insert into abc values(1); --报错insert in ddl transaction is not supported now commit;
说明 如果您在事务内DML和DDL已经混用,可以通过如下命令语句修改参数保持数据库级别兼容。alter database <db_name> set hg_experimental_enable_dml_in_ddl_transaction_block = on; --db_name为数据库名称