在数据管理DMS的SQL Console页面执行SQL语句时,出现执行超时问题,执行结果页面提示以下信息。
[语句1]:
select count(*) from table_name where gmt_create>='2020-01-01';
失败, 详情: 操作终止(用户中断或执行超时)
【解决方法】:
1、在查询条件中增加索引列提升查询性能。
2、尽可能的缩小查询范围。
3、安全协同的实例可以提交结构设计工单对查询列增加索引。
4、通过编辑实例重新设置实例的查询超时时间。
TraceId : 0bc059b716002426281173397e58b3
具体信息如下图所示。
说明:本文中的SQL语句为示例,具体情况请以实际环境为准。
出现该问题后,您可以通过以下方法解决问题:
select count(*) from table_name where gmt_create>='2020-01-01' and user_id = '1000';
select count(*) from table_name where gmt_create>='2020-01-01' and gmt_create<'2020-04-01';
alter table table_name add index idx_gmt(gmt_create);
说明:本文查询超时时间以60s为例。
在文档使用中是否遇到以下问题
更多建议
匿名提交