Memory usage of a specific document

Is there any way to determine the amount of memory a specific document will or is taking up? It doesn't need to be done in a query (as I don't think there is one). Would it be possible to write a function that takes in the JSON for a document, it's mapping, and returns memory usage? If so, how would that function work?

What sort of memory though - field data, global ordinals, doc values cached by OS, query/aggs?

Basically, it's complicated and I don't think there would be a single way of doing this. The explain API may be able to cover this, but I think there'd be a lot of changes to do it.

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