The significant_terms aggregation always executes in depth_first mode when sub-aggregations are provided. This mode uses a lot of memory since the sub-aggs need to be computed on all buckets. We should automatically switch to the breadth_first mode like the terms aggregation does in order to make sure that we don't use too much memory for buckets that will not survive the pruning.