Slow child query: Elasticsearch parent child query profile analysis showing using time for unrealetd children I was not quering

I have join type field mapping,

{
	"properties": {
		"data_type": {
			"type": "join",
			"eager_global_ordinals": true,
			"relations": {
				"contact": [
					"user_published_contact",
					"crm_lead_email",
					"crm_contact_email"
				],
				"company": [
					"user_published_company",
					"audience_company",
					"crm_account",
					"model_fitscore",
					"exclusion_company",
					"company_intent",
					"crm_contact",
					"company_department",
					"crm_lead",
					"business_tags",
					"contact",
					"company_ucc_insights",
					"similar_domain"
				]
			}
		}
	}
}

But when I try to only query one type of child with profile api, it returns the following result:
Query:

    GET eap_company_20190325_v2/_search
{
  "profile": true,
  "size": 10,
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "data_type": "model_fitscore"
          }
        },
        {
          "term": {
            "model_id": 10000001
          }
        },
        {
          "has_parent": {
            "parent_type": "company",
            "query": {
              "bool": {
                "filter": [
                  {
                    "term": {
                      "use_case": 1
                    }
                  },
                  {
                    "has_child": {
                      "type": "crm_lead",
                      "query": {
                        "bool": {
                          "must": [
                            {
                              "term": {
                                "domain": "ibm.com"
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    }
  }
}

Partial Result:

"children": [
                              {
                                "type": "TermQuery",
                                "description": "data_type:user_published_company",
                                "time_in_nanos": 73333,
                                "breakdown": {
                                  "score": 0,
                                  "build_scorer_count": 26,
                                  "match_count": 0,
                                  "create_weight": 645,
                                  "next_doc": 0,
                                  "match": 0,
                                  "create_weight_count": 1,
                                  "next_doc_count": 0,
                                  "score_count": 0,
                                  "build_scorer": 61047,
                                  "advance": 11611,
                                  "advance_count": 3
                                }
                              }

Can anyone let me know why it showing other types(for example, user_published_company) of children(which I didn't query) profile context which may contribute the query slowness?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.