irpas技术客

【索引类型、数据库版本】PSQL报错:cache lookup failed for type 0_女可

网络 5183

报错信息 \n### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: cache lookup failed for type 0\n### The error may exist in class path resource [mapper/RegionElementRiskEvaluateMapper.xml]\n### The error may involve diit.microservice.mapper.MajorDangerousEvaluate.RegionElementRiskEvaluateMapper.getPgData-Inline\n### The error occurred while setting parameters\n### SQL: SELECT count(0) FROM qyzzt_std_g_zj_risk_census_city_house\n### Cause: org.postgresql.util.PSQLException: ERROR: cache lookup failed for type 0\n; uncategorized SQLException; SQL state [XX000]; error code [0]; ERROR: cache lookup failed for type 0; nested exception is org.postgresql.util.PSQLException: ERROR: cache lookup failed for type 0" 解决方案

1、 修改索引方法类型 2、 升级PGSQL版本 因为现场PGSQL版本升级对数据影响有很多不确定性,所以最终选择了修改空间字段geom的索引类型。

以前的索引类型:SP-GIST 改后的索引类型:GIST

报错原因

postgreSQL的版本bug。 参考博客(外网帖子):

Bug还原 系统配置

现场服务器 物理内存:16G postgresql 11.12:共享缓存2G Linux 7.6 centos postgis 2.5.2 数据库连接:249

本地服务器 物理内存:16G postgresql 11.13:共享缓存128M windows 数据库连接:64

报错特性描述 现场部署的系统,当查询数据量较大时,就报这个错;当把表的数据改为只有1条数据时,查询不报错在现场的navicat中执行sql不报错在本地启动项目,测试时也不报错查询报错的库表,都包含空间字段 已验证的无效方案

× 将视图改为表,数据直接从表中获取 × 进程多,并发导致 × 修改现场服务的postgresql配置: 修改以下参数: alter system set shared_buffers = ‘6GB’; alter system set work_mem = ‘50MB’; alter system set effective_cache_size=‘16GB’; 重启数据库


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #lookup #failed #for #type