高峰只对攀登它而不是仰望它的人来说才有真正意义。

单机单节点无集群慢查询分析和优化

Elasticsearch | 作者 chiefyang | 发布于2020年12月14日 | 阅读数:703

有个慢查询  es6.3     live_msg  大概6.3G 数据  单机 单节点 无集群 查询慢 请教如何优化
 查询语句
GET live_msg/_search
{
"profile": true,
"query": {
"bool": {
"filter": [
{
"term": {
"l_id": 48
}
},
{
"match_phrase": {
"content": "盘面"
}
},
{
"terms": {
"kind": [
"charge",
"free"
]
}
},
{
"bool": {
"should": [
{
"bool": {
"must_not": {
"wildcard": {
"state": {
"value": "*"
}
}
}
}
},
{
"term": {
"state": "del_own"
}
}
]
}
},
{
"bool": {
"must_not": [
{
"wildcard": {
"unshow_group": {
"value": "*"
}
}
},
{
"term": {
"view_self": "yes"
}
}
]
}
},
{
"bool": {
"should": [
{
"bool": {
"must_not": {
"term": {
"not_vip_show": "no"
}
}
}
},
{
"bool": {
"filter": [
{
"range": {
"create_time": {
"gt": 1602299785
}
}
},
{
"bool": {
"must_not": {
"term": {
"vip_show": "no"
}
}
}
}
]
}
}
]
}
}
]
}
},
"from": 0,
"size": 5,
"sort": {
"create_time": {
"order": "desc",
"unmapped_type": "long"
}
},
"_source":["id","create_time"]
}
 
返回结果
[code]{
"took": 23,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 135,
"max_score": null,
"hits": [
{
"_index": "live_msg",
"_type": "doc",
"_id": "1790100",
"_score": null,
"_source": {
"create_time": 1607652349,
"id": 1790100
},
"sort": [
1607652349
]
},
{
"_index": "live_msg",
"_type": "doc",
"_id": "1789742",
"_score": null,
"_source": {
"create_time": 1607594706,
"id": 1789742
},
"sort": [
1607594706
]
},
{
"_index": "live_msg",
"_type": "doc",
"_id": "1789427",
"_score": null,
"_source": {
"create_time": 1607573207,
"id": 1789427
},
"sort": [
1607573207
]
},
{
"_index": "live_msg",
"_type": "doc",
"_id": "1788881",
"_score": null,
"_source": {
"create_time": 1607508708,
"id": 1788881
},
"sort": [
1607508708
]
},
{
"_index": "live_msg",
"_type": "doc",
"_id": "1788140",
"_score": null,
"_source": {
"create_time": 1607476067,
"id": 1788140
},
"sort": [
1607476067
]
}
]
},
"profile": {
"shards": [
{
"id": "[GddjX_VlRKqP8VfseBxr8g][live_msg][0]",
"searches": [
{
"query": [
{
"type": "BooleanQuery",
"description": """#l_id:[48 TO 48] #content:"盘 面" #ConstantScore(kind:charge kind:free) #(((-state:* +*:*) state:del_own)~1) #(-unshow_group:* -view_self:yes +*:*) #(((-not_vip_show:no +*:*) (#create_time:[1602299786 TO 9223372036854775807] #(-vip_show:no +*:*)))~1)""",
"time_in_nanos": 22093991,
"breakdown": {
"score": 0,
"build_scorer_count": 34,
"match_count": 301,
"create_weight": 302787,
"next_doc": 12177851,
"match": 5006144,
"create_weight_count": 1,
"next_doc_count": 395,
"score_count": 0,
"build_scorer": 4606478,
"advance": 0,
"advance_count": 0
},
"children": [
{
"type": "PointRangeQuery",
"description": "l_id:[48 TO 48]",
"time_in_nanos": 3619099,
"breakdown": {
"score": 0,
"build_scorer_count": 50,
"match_count": 0,
"create_weight": 1153,
"next_doc": 231403,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 372,
"score_count": 0,
"build_scorer": 1124019,
"advance": 2258091,
"advance_count": 4010
}
},
{
"type": "PhraseQuery",
"description": """content:"盘 面"""",
"time_in_nanos": 6497003,
"breakdown": {
"score": 0,
"build_scorer_count": 50,
"match_count": 191,
"create_weight": 247881,
"next_doc": 29074,
"match": 435369,
"create_weight_count": 1,
"next_doc_count": 23,
"score_count": 0,
"build_scorer": 207030,
"advance": 5573025,
"advance_count": 4359
}
},
{
"type": "ConstantScoreQuery",
"description": "ConstantScore(kind:charge kind:free)",
"time_in_nanos": 2598590,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 7335,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 392416,
"advance": 2198352,
"advance_count": 438
},
"children": [
{
"type": "BooleanQuery",
"description": "kind:charge kind:free",
"time_in_nanos": 2077533,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 4644,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 346436,
"advance": 1725966,
"advance_count": 438
},
"children": [
{
"type": "TermQuery",
"description": "kind:charge",
"time_in_nanos": 580791,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 1082,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 146013,
"advance": 433267,
"advance_count": 380
}
},
{
"type": "TermQuery",
"description": "kind:free",
"time_in_nanos": 719740,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 737,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 66465,
"advance": 652051,
"advance_count": 438
}
}
]
}
]
},
{
"type": "BooleanQuery",
"description": "((-state:* +*:*) state:del_own)~1",
"time_in_nanos": 5308612,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 301,
"create_weight": 9069,
"next_doc": 0,
"match": 2413639,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 1219992,
"advance": 1665167,
"advance_count": 395
},
"children": [
{
"type": "BooleanQuery",
"description": "-state:* +*:*",
"time_in_nanos": 3787152,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 300,
"create_weight": 7580,
"next_doc": 0,
"match": 2063112,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 994468,
"advance": 721248,
"advance_count": 395
},
"children": [
{
"type": "MultiTermQueryConstantScoreWrapper",
"description": "state:*",
"time_in_nanos": 2610110,
"breakdown": {
"score": 0,
"build_scorer_count": 32,
"match_count": 0,
"create_weight": 835,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 880410,
"advance": 1728534,
"advance_count": 298
}
},
{
"type": "MatchAllDocsQuery",
"description": "*:*",
"time_in_nanos": 261088,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 746,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 25311,
"advance": 234587,
"advance_count": 395
}
}
]
},
{
"type": "TermQuery",
"description": "state:del_own",
"time_in_nanos": 456437,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 271,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 97309,
"advance": 358545,
"advance_count": 263
}
}
]
},
{
"type": "BooleanQuery",
"description": "-unshow_group:* -view_self:yes +*:*",
"time_in_nanos": 1849248,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 301,
"create_weight": 11557,
"next_doc": 0,
"match": 699636,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 495987,
"advance": 641323,
"advance_count": 395
},
"children": [
{
"type": "MultiTermQueryConstantScoreWrapper",
"description": "unshow_group:*",
"time_in_nanos": 486835,
"breakdown": {
"score": 0,
"build_scorer_count": 22,
"match_count": 0,
"create_weight": 775,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 296041,
"advance": 189918,
"advance_count": 78
}
},
{
"type": "TermQuery",
"description": "view_self:yes",
"time_in_nanos": 241175,
"breakdown": {
"score": 0,
"build_scorer_count": 32,
"match_count": 0,
"create_weight": 708,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 73065,
"advance": 167155,
"advance_count": 214
}
},
{
"type": "MatchAllDocsQuery",
"description": "*:*",
"time_in_nanos": 246030,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 632,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 22796,
"advance": 222158,
"advance_count": 395
}
}
]
},
{
"type": "BooleanQuery",
"description": "((-not_vip_show:no +*:*) (#create_time:[1602299786 TO 9223372036854775807] #(-vip_show:no +*:*)))~1",
"time_in_nanos": 2969660,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 301,
"create_weight": 17460,
"next_doc": 0,
"match": 727253,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 880342,
"advance": 1343860,
"advance_count": 395
},
"children": [
{
"type": "BooleanQuery",
"description": "-not_vip_show:no +*:*",
"time_in_nanos": 1185966,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 287,
"create_weight": 4552,
"next_doc": 0,
"match": 364007,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 168798,
"advance": 647878,
"advance_count": 395
},
"children": [
{
"type": "TermQuery",
"description": "not_vip_show:no",
"time_in_nanos": 175041,
"breakdown": {
"score": 0,
"build_scorer_count": 30,
"match_count": 0,
"create_weight": 2041,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 69392,
"advance": 103430,
"advance_count": 147
}
},
{
"type": "MatchAllDocsQuery",
"description": "*:*",
"time_in_nanos": 247820,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 246,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 22466,
"advance": 224664,
"advance_count": 395
}
}
]
},
{
"type": "BooleanQuery",
"description": "#create_time:[1602299786 TO 9223372036854775807] #(-vip_show:no +*:*)",
"time_in_nanos": 808168,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 12,
"create_weight": 10627,
"next_doc": 0,
"match": 20220,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 590898,
"advance": 186319,
"advance_count": 43
},
"children": [
{
"type": "IndexOrDocValuesQuery",
"description": "create_time:[1602299786 TO 9223372036854775807]",
"time_in_nanos": 348915,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 10,
"create_weight": 995,
"next_doc": 0,
"match": 6938,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 285780,
"advance": 55100,
"advance_count": 43
}
},
{
"type": "BooleanQuery",
"description": "-vip_show:no +*:*",
"time_in_nanos": 242175,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 2,
"create_weight": 5542,
"next_doc": 0,
"match": 2478,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 163369,
"advance": 70692,
"advance_count": 43
},
"children": [
{
"type": "TermQuery",
"description": "vip_show:no",
"time_in_nanos": 65901,
"breakdown": {
"score": 0,
"build_scorer_count": 28,
"match_count": 0,
"create_weight": 940,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 64275,
"advance": 656,
"advance_count": 1
}
},
{
"type": "MatchAllDocsQuery",
"description": "*:*",
"time_in_nanos": 44787,
"breakdown": {
"score": 0,
"build_scorer_count": 48,
"match_count": 0,
"create_weight": 966,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 22957,
"advance": 20772,
"advance_count": 43
}
}
]
}
]
}
]
}
]
},
{
"type": "BooleanQuery",
"description": "state:_del state:del state:del_b state:del_del state:del_l state:del_o state:del_own state:del_r state:del_u state:del_una state:dn_ state:dn_del_own state:una",
"time_in_nanos": 749582,
"breakdown": {
"score": 0,
"build_scorer_count": 2,
"match_count": 0,
"create_weight": 21227,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 81033,
"advance": 647155,
"advance_count": 164
},
"children": [
{
"type": "TermQuery",
"description": "state:_del",
"time_in_nanos": 9702,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 127,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 4729,
"advance": 4836,
"advance_count": 6
}
},
{
"type": "TermQuery",
"description": "state:del",
"time_in_nanos": 226748,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 705,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2591,
"advance": 223286,
"advance_count": 162
}
},
{
"type": "TermQuery",
"description": "state:del_b",
"time_in_nanos": 7566,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 1659,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3984,
"advance": 1917,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "state:del_del",
"time_in_nanos": 4332,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 611,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2787,
"advance": 928,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "state:del_l",
"time_in_nanos": 35664,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 219,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2586,
"advance": 32817,
"advance_count": 38
}
},
{
"type": "TermQuery",
"description": "state:del_o",
"time_in_nanos": 13622,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 652,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 4616,
"advance": 8344,
"advance_count": 6
}
},
{
"type": "TermQuery",
"description": "state:del_own",
"time_in_nanos": 56374,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 737,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3412,
"advance": 52181,
"advance_count": 40
}
},
{
"type": "TermQuery",
"description": "state:del_r",
"time_in_nanos": 3939,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 710,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3221,
"advance": 2,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "state:del_u",
"time_in_nanos": 30496,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 544,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 1640,
"advance": 28273,
"advance_count": 35
}
},
{
"type": "TermQuery",
"description": "state:del_una",
"time_in_nanos": 7712,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 705,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 4978,
"advance": 2022,
"advance_count": 3
}
},
{
"type": "TermQuery",
"description": "state:dn_",
"time_in_nanos": 5919,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 686,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3138,
"advance": 2089,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "state:dn_del_own",
"time_in_nanos": 5139,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 648,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3343,
"advance": 1142,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "state:una",
"time_in_nanos": 6062,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 669,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3452,
"advance": 1932,
"advance_count": 5
}
}
]
},
{
"type": "BooleanQuery",
"description": "state:del state:del_l state:del_own state:del_u",
"time_in_nanos": 245552,
"breakdown": {
"score": 0,
"build_scorer_count": 2,
"match_count": 0,
"create_weight": 14439,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 31891,
"advance": 199186,
"advance_count": 33
},
"children": [
{
"type": "TermQuery",
"description": "state:del",
"time_in_nanos": 47494,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 2096,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 5067,
"advance": 40294,
"advance_count": 33
}
},
{
"type": "TermQuery",
"description": "state:del_l",
"time_in_nanos": 23472,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 615,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2979,
"advance": 19849,
"advance_count": 25
}
},
{
"type": "TermQuery",
"description": "state:del_own",
"time_in_nanos": 61902,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 609,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2891,
"advance": 58370,
"advance_count": 28
}
},
{
"type": "TermQuery",
"description": "state:del_u",
"time_in_nanos": 4244,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 366,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2538,
"advance": 1334,
"advance_count": 2
}
}
]
},
{
"type": "BooleanQuery",
"description": "unshow_group:176 unshow_group:176,7 unshow_group:185,991 unshow_group:23 unshow_group:334 unshow_group:7 unshow_group:913 unshow_group:991",
"time_in_nanos": 107791,
"breakdown": {
"score": 0,
"build_scorer_count": 2,
"match_count": 0,
"create_weight": 14494,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 46764,
"advance": 46515,
"advance_count": 15
},
"children": [
{
"type": "TermQuery",
"description": "unshow_group:176",
"time_in_nanos": 5271,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 805,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3285,
"advance": 1175,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "unshow_group:176,7",
"time_in_nanos": 3420,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 378,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2540,
"advance": 496,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "unshow_group:185,991",
"time_in_nanos": 4876,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 996,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2815,
"advance": 1059,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "unshow_group:23",
"time_in_nanos": 6233,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 1149,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 4006,
"advance": 1072,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "unshow_group:334",
"time_in_nanos": 9272,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 855,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3382,
"advance": 5023,
"advance_count": 8
}
},
{
"type": "TermQuery",
"description": "unshow_group:7",
"time_in_nanos": 6505,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 501,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3432,
"advance": 2564,
"advance_count": 4
}
},
{
"type": "TermQuery",
"description": "unshow_group:913",
"time_in_nanos": 7988,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 783,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 4878,
"advance": 2319,
"advance_count": 4
}
},
{
"type": "TermQuery",
"description": "unshow_group:991",
"time_in_nanos": 7184,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 433,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2543,
"advance": 4197,
"advance_count": 7
}
}
]
},
{
"type": "BooleanQuery",
"description": "state:del state:del_l state:del_own",
"time_in_nanos": 124601,
"breakdown": {
"score": 0,
"build_scorer_count": 2,
"match_count": 0,
"create_weight": 6874,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 26080,
"advance": 91627,
"advance_count": 17
},
"children": [
{
"type": "TermQuery",
"description": "state:del",
"time_in_nanos": 22338,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 1731,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 4322,
"advance": 16265,
"advance_count": 16
}
},
{
"type": "TermQuery",
"description": "state:del_l",
"time_in_nanos": 18176,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 1457,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2982,
"advance": 13718,
"advance_count": 15
}
},
{
"type": "TermQuery",
"description": "state:del_own",
"time_in_nanos": 26614,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 1,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3350,
"advance": 23242,
"advance_count": 17
}
}
]
},
{
"type": "BooleanQuery",
"description": "unshow_group:23 unshow_group:334 unshow_group:913",
"time_in_nanos": 40676,
"breakdown": {
"score": 0,
"build_scorer_count": 2,
"match_count": 0,
"create_weight": 5744,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 19872,
"advance": 15051,
"advance_count": 6
},
"children": [
{
"type": "TermQuery",
"description": "unshow_group:23",
"time_in_nanos": 5610,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 857,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3053,
"advance": 1694,
"advance_count": 2
}
},
{
"type": "TermQuery",
"description": "unshow_group:334",
"time_in_nanos": 7861,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 1475,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 3263,
"advance": 3115,
"advance_count": 4
}
},
{
"type": "TermQuery",
"description": "unshow_group:913",
"time_in_nanos": 5967,
"breakdown": {
"score": 0,
"build_scorer_count": 3,
"match_count": 0,
"create_weight": 1020,
"next_doc": 0,
"match": 0,
"create_weight_count": 1,
"next_doc_count": 0,
"score_count": 0,
"build_scorer": 2811,
"advance": 2129,
"advance_count": 3
}
}
]
},
{
"type": "BooleanQuery",
"description": "state:_del state:del state:del_del state:del_l state:del_o state:del_own state:del_u state:una",
"time_in_nanos": 281195,
"breakdown": {
"score": 0,
"build_scorer_count": 2,
"match_count": 0,
"create_weight": 14121,
"next_doc": 0,
已邀请:

pony_maggie - 公众号:犀牛饲养员的技术笔记

赞同来自:

有模糊查询,查询慢正常。可以考虑根据业务场景,把可能出现的词在索引阶段就写入(了解下ngram分析器),然后用term查询。
 

chiefyang - 80

赞同来自:

谢谢  麻烦问下 这个profile 分析的结果   每个结果都怎么解决 有什么好的文章介绍吗  一脸懵逼 新手谢谢

要回复问题请先登录注册