麻烦大牛解惑下:目前有3亿条数据,按照某字段聚合时响应时间太慢。已经拆分过DSL,目前最慢达到30s,还能怎么优化呢?
{
"size": 0,
"query": {
"bool": {
"must": {
"bool": {
"should": {
"terms": {
"hour_tag": [
"00-07",
"08-11",
"18-23"
]
}
}
}
}
}
},
"explain": true,
"aggregations": {
"proName": {
"terms": {
"field": "pro_name",
"size": 1
}
},
"sex": {
"terms": {
"field": "sex",
"size": 10000
}
}
}
}
已经尝试添加过"collect_mode": "breadth_first"和"execution_hint": "map"字段,但效果并不好,甚至更差。应该是文档数量较多此方法不太合适了吧。
1 个回复
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: