Parent Child Mapping Load Time

We have encountered a situation with parent child documents where loading the mapping into memory is taking 15+ seconds. Per https://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child-performance.html, we are constantly indexing and we have many parents (160m split over 6 shards). We are using the child documents to score search results. Queries that do not use the child documents run fast, and the queries speed up significantly when we increase our refresh_interval to 60s, except for the query that causes global ordinals to load. Unfortunately, the query time is a significant percentage of our acceptable refresh_interval, and we don't want to have index refreshes longer than a minute.

We looked at but did not try eager loading of global ordinals because it appeared to us that that would cause a lot of load on the nodes and still end up blocking queries.

Our child/parent ratio is exactly 1:1 so we decided to de-normalize and put the child information back into the parent and take the performance hit on reindexing.

Have we taken the right approach? Is there something else or another solution to consider?

Hey,

Which version of Elasticsearch are you using? Parent-Child changed a lot in 2.x and you may want to give it a try. The definitive guide is not up-to-date in that regard.

That said, with a 1:1 mapping, I would almost always try take the indexing performance hit and have fast queries. Basically parent child allows you do something on query time, that you could also do on index-time, albeit much slower.

--Alex

Hi Alex,

We moved to 2.3.3 and at the same time really started using Parent-Child.

Thanks for the thought on the 1:1 to always take the indexing performance hit. We are heading that way. Our child documents are a significant part of the total parent/child anyway - approximately 10-20% by size. Reindexing is going well such that taking the hit on indexing should work fine in our case.

Thanks,
Todd