Ordering

Normally, the events in a bucket are kept by order of arrival. You can specify a different ordering by the fields of the events.

For instance, to keep the events in the bucket ordered by field d in descending order:
eventCache(instream, d desc) e0;
            
You can order by more than one field. The following example orders the buckets by field d0 in descending order, then by field d1 in ascending order in case the d0 fields are equal.
eventCache(instream, d0 desc, d1 asc) e0;