-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching many fields takes much more time than retrieving _source #96349
Comments
Pinging @elastic/es-search (Team:Search) |
Hi @mayya-sharipova |
I've done some testing trying to reproduce this issue and ruled out some of potential scenarios like reparsing each source for each requested field (this is NOT happening as we only parse the source once per document and cache it) or reloading the source from stored fields for each document. I've run an extensive set of micro benchmarks for parsing fields and extracting values from the source (with various source configurations like 100k fields, fewer but larger fields - 4MB each, 10k fields with large arrays, and a mix of all of these) and was not able to reproduce the slowdown. Finally, I've turned my attention to benchmarking fetching the values from source (https://github.com/elastic/elasticsearch/blob/main/server/src/main/java/org/elasticsearch/index/mapper/SourceValueFetcher.java#L56) as I suspected parsing some field types might be more heavy than others. This way I believe I've found a case where retrieving 100 timestamp fields, from 8k documents takes 2 - 2.5 seconds on one Elasticsearch nodes (whilst retrieving the whole source takes This is due to the data parsing we execute when retrieving the fields. I'll keep this issue open for a few more days to potentially collect more comments but otherwise I believe we should rely on the improvements we make to date/time parsing to speed up the retrieval of many |
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Closing this for now but please reopen if more details/information is available. |
In a search request, asking to retrieve many fields can take substantially more time than retrieving the whole source.
For example, tested in ES 8.6 asking to retrieve 200 fields takes > 6s. On the same shard without fetching fields, but grabbing the whole source takes around 139 ms.
The text was updated successfully, but these errors were encountered: