记录一个bug情况:

我有个表NewTable,复合主键(slaveid,resid,owner)

CREATE TABLE "public"."NewTable" (
"slaveid" varchar() NOT NULL,
"resid" varchar() NOT NULL,
"owner" varchar(2) NOT NULL,
"a" bool,
"b" int4,
"c" text,
"ddd" varchar(),
"e" timestamp(),
"f" timestamp(),
PRIMARY KEY ("owner", "resid", "slaveid")
)
WITH (OIDS=FALSE)
;

存数据进去的时候,slaveid,resid,owner三个字段都特别长,达到几万字节,其他字段长度的只有几十

那么问题来了,当入参足够长的时候,会报错如下

[Err] ERROR:  index row size  exceeds maximum  for index "pk_t_portal_slave_extend"
HINT: Values larger than / of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text indexing.

原因:报错说 超过缓存1/3大小就不予检索,也就是说

length(slaveid + resid +owner) / length(所有入参字节总和)  > 1/3

则认为主键长度太大,就数据库就放弃检索复合主键是否唯一,就报错不处理了。

解决办法,正在尝试,参看:

Consider a function index of an MD5 hash of the value, or use full text indexing.

index row size 2720 exceeds maximum 2712 for index "xxx" ,Values larger than 1/3 of a buffer page cannot be indexed.的更多相关文章

  1. Limits on Table Column Count and Row Size Databases and Tables Table Size 最大行数

    MySQL :: MySQL 8.0 Reference Manual :: C.10.4 Limits on Table Column Count and Row Size https://dev. ...

  2. mysql 1709: Index column size too large. The maximum column size is 767 bytes.

    1709: Index column size too large. The maximum column size is 767 bytes. 修改排序规则解决 utf8_general_ci

  3. Index column size too large. The maximum column size is 767 bytes.

    mysql建表时报Index column size too large. The maximum column size is 767 bytes.解决办法:在建表语句的后面加入:ENGINE=In ...

  4. ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes.

    MySQL版本5.6.35 在一个长度为512字符的字段上创建unique key报错 CREATE DATABASE dpcs_metadata DEFAULT CHARACTER SET utf8 ...

  5. 【bug】 1118 Row size too large

    1118 Row size too large Every table (regardless of storage engine) has a maximum row size of 65,535 ...

  6. mysql row size上限

    mysql innodb 的 row size上限 背景 在项目使用中,出现了以下报错: Error Code: 1118 - Row size too large (> 8126). Chan ...

  7. mysql 报Row size too large 65535 原因与解决方法

    报错信息:Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535 ...

  8. Mysql_大字段问题Row size too large.....not counting BLOBs, is 8126.

    [问题描述] 1.从myslq(5.7.19-0ubuntu0.16.04.1)中导出sql脚本,导入到mysql(5.5.27)中,报如下错误:Row size too large. The max ...

  9. FAIL - Deploy Upload Failed, Exception: [org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (112503036) exceeds the configured

    Message:  FAIL - Deploy Upload Failed, Exception: [org.apache.tomcat.util.http.fileupload.FileUpload ...

随机推荐

  1. 改变默认的多选框 checkbox 样式~

    效果图: HTML代码: <label for="Checkbox1" style="display:none;"></label> & ...

  2. Django-视图函数view

    目录 1.Django的视图函数view 1.1一个简单的视图 2.CBV和FBV 3.使用Mixin(了解) 4.给视图加装饰器 4.1使用装饰器装饰FBV 4.2使用装饰器装饰CBV 5.requ ...

  3. CodeCombat第一关:KITHGARD地牢之KITHGARD精通

    https://www.cnblogs.com/OctoptusLian/p/7397602.html https://www.jianshu.com/p/065581a84879 https://w ...

  4. 从客户端(content="xxxxx")中检测到有潜在危险的 Request.Form 值——较合理解决方案

    1,修改配置文件: <httpRuntime requestValidationMode = "2.0" /> 以上修改是必须的,因为高版本的.netframework ...

  5. 【Difference Between Primes HDU - 4715】【素数筛法打表+模拟】

    这道题很坑,注意在G++下提交,否则会WA,还有就是a或b中较大的那个数的范围.. #include<iostream> #include<cstdio> #include&l ...

  6. linux用户的问题

    最近在开发的时候遇到一个问题: 我在某个项目下的某个文件夹内写了一个可以单独run的A.py文件,这个文件里面的代码可以调用kubernetes的python接口来请求kubernetes上的信息(比 ...

  7. delete,drop,truncate的区别?

    drop:是删除表的结构 delete:删除表的数据 truncate:删除表的数据,并且对id进行重新排序.

  8. 用wpjam插件的朋友记得勾选移除工具栏

    今天ytkah在调试页面的时候发现网页一直出现32px高度的空白,非常奇怪,样式如下,全盘查找了关键词也没找到对应的样式文件,后面想到wpjam插件好像有个屏蔽选项,到那边设置一下说不定可以 < ...

  9. ACM-ICPC 2018 南京赛区现场赛 K. Kangaroo Puzzle (思维+构造)

    题目链接:https://codeforc.es/gym/101981/attachments 题意:在 n * m 的平面上有若干个袋鼠和墙(1为袋鼠,0为墙),每次可以把所有袋鼠整体往一个方向移动 ...

  10. 51nod1423 最大二“货”

    [传送门] 单调栈其实就是个后缀$max/min$,这道题可以维护一个单调递减的单调栈,pop元素的时候,能pop掉的元素就是第二大,当前元素为第一大.遇到第一个不能pop掉的时候当前元素就是第二大, ...