You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What solution would you like?
If an index contains index.sort.field, implicit sorting by index.sort.field.
If an data stream contains @timestamp, implicit sorting by @timestamp.
Excepts, keep as is sorting by _id + _doc
Thanks for the context! I set up a 1TB Big5 test environment on 3 EC2 nodes (balanced with ~150GB per node) to benchmark performance for implicit sorting by _doc vs. @timestamp.
I used this query: source=big5 | head [number of rows] | reverse
Results: See #3925 for detailed performance table.
Default behavior: sorting is by _doc AND _id. Works only for 10K rows; fails for larger row counts.
I compared only sorting by _doc and only sorting by @timestamp:
Up to 50K rows: both _doc and @timestamp succeed, with @timestamp slightly faster (avg ~1.8–3.7s vs. _doc ~1.9–4.1s).
100K rows:_doc is slower (~9.0s avg) but stable. @timestamp appears faster (~2.4s avg), but 2 out of 3 runs failed with backend resource errors.
200K rows: both _doc and @timestamp hit resource errors.
This aligns with the proposal that implicit sorting by index.sort.field (or @timestamp for data streams) could improve performance for typical time-series workloads, while still allowing _doc sorting as a fallback for heavy scans.
Activity
penghuo commentedon Jul 25, 2025
similar issue, #3925 (comment)
@selsong is helping verify sort by [_doc, @timestamp] with Big5 dataset.
LantaoJin commentedon Aug 11, 2025
The big5 contains
@timestampfield, for others, opensearch-project/OpenSearch#18924 should resolve our problem.selsong commentedon Aug 18, 2025
Thanks for the context! I set up a 1TB Big5 test environment on 3 EC2 nodes (balanced with ~150GB per node) to benchmark performance for implicit sorting by _doc vs.
@timestamp.I used this query:
source=big5 | head [number of rows] | reverseResults: See #3925 for detailed performance table.
_docAND_id. Works only for 10K rows; fails for larger row counts.I compared only sorting by _doc and only sorting by
@timestamp:_docand@timestampsucceed, with@timestampslightly faster (avg ~1.8–3.7s vs._doc~1.9–4.1s)._docis slower (~9.0s avg) but stable.@timestampappears faster (~2.4s avg), but 2 out of 3 runs failed with backend resource errors._docand@timestamphit resource errors.This aligns with the proposal that implicit sorting by
index.sort.field(or@timestampfor data streams) could improve performance for typical time-series workloads, while still allowing_docsorting as a fallback for heavy scans.