5

几百万的表,用户喜欢用 备注 来查询,备注没发上索引,这个该怎么解决,能查询快一些...

 3 years ago
source link: https://www.v2ex.com/t/789766
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

几百万的表,用户喜欢用 备注 来查询,备注没发上索引,这个该怎么解决,能查询快一些!

  kikione · 6 小时 23 分钟前 · 980 次点击

几百万的表,用户喜欢用 备注 来查询,备注没发上索引,这个该怎么解决,能查询快一些!

大家帮我给些方案,参考一下

10 条回复    2021-07-15 23:11:09 +08:00

xiaofan2

xiaofan2   6 小时 11 分钟前

ccde8259

ccde8259   5 小时 38 分钟前 via iPhone

等值查询开列存哈希上索引
按部分内容查请全文索引用 match against

carity

carity   5 小时 37 分钟前

changwei

changwei   5 小时 20 分钟前

是 MySQL 吗?据我所知 MySQL 的 innodb 索引键长度最大只有 1000bytes,不然可以考虑用 ES 搜索引擎

chenshun00

chenshun00   5 小时 8 分钟前

关注点
1 、几百万的表
2 、用户系统用备注来查询

1 、有多少用户
用户的区分度
2 、

YUyu101

YUyu101   3 小时 30 分钟前 via Android

没法上全文索引?上 es

dzdh

dzdh   2 小时 51 分钟前

PostgreSQL 无压力

如果备注内容不多不复杂的话,tsvector 自己拆都行

Huelse

Huelse   2 小时 11 分钟前

@dzdh pg +1,这玩意儿是真叼

zhucelws

zhucelws   2 小时 5 分钟前   ❤️ 1

看标题第一句,以为是什么百达翡丽、江诗丹顿

xmumiffy

xmumiffy   1 小时 17 分钟前

每个用户有多少数据?没上万全查出来程序里过滤

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK