Multiply percentiles over same column

Hi, i have to calculate multiply(10,20…90) percentiles for the same column.
i am using PERCENTILE_DISC N times in my SELECT.
The issue is that it makes my query almost N times slower.
From execution plan looks like each individual PERCENTILE_DISC call produces same steps multiply times => hash_partition, window, external_sort and etc. For the same column it seems redundant.

It makes my query executing forever.

Is there a way to speed up my query? We are on Dremio 24.0.1-202303312317430103-9ff7aeed AWS(activated).

  1. will dremio approx_percentile be much faster to use?
  2. in Athena we used approx_percentile(*x* , *percentages* ) → array<[same as x]> which gives you possibility to calculate multiply percentile at once.

@vladislav-stolyarov It is best to use approx_percentile and then send both profile so we can see if the plan can be optimized. Is that something you can do?