Anonymous
Not applicable

@Hanan Shteingart​ : To optimize queries with window functions, you should try multiple things like - filter the data, reduce the number of columns used in the window, optimize the window partitioning and ordering, and increase the cluster size if needed. Please try the below options

  1. FIlter the dataset df before applying the window function
  2. Reduce the number of columns in df before applying the window function
  3. Partition the dataframe df by choosing the right partition key that reduces the number of partitions and distributes the data evenly across the partitions
  4. Choose an ordering key that reduces the amount of data that needs to be sorted and processed
  5. Final resort, increase the size of your cluster to allocate more computing resources to the query