title: Postgresql Writing max() Window function with multiple partition expressions?
body: <p>I am trying to get the max value of column A ("original_list_price") over windows defined by 2 columns (namely - a unique identifier, called "address_token", and a date field, called "list_date"). I.e. I would like to know the max "original_list_price" of rows with both the same address_token AND list_date. </p>
  
  <p>E.g.:</p>
  
  <pre><code>SELECT 
  address_token, list_date, original_list_price, 
  max(original_list_price) OVER (PARTITION BY address_token, list_date) as max_list_price
  FROM table1  
  </code></pre>
  
  <p>The query already takes >10 minutes when I use just 1 expression in the PARTITION (e.g. using address_token only, nothing after that). Sometimes the query times out. (I use Mode Analytics and get this error: An I/O error occurred while sending to the backend) So my questions are:</p>
  
  <p>1) Will the Window function with multiple PARTITION BY expressions work?</p>
  
  <p>2) Any other way to achieve my desired result? </p>
  
  <p>3) Any way to make Windows functions, especially the Partition part run faster? e.g. use certain data types over others, try to avoid long alphanumeric string identifiers? </p>
  
  <p>Thank you!</p>