title: reduce the amount of data scanned by Athena when using aggregate functions
body: <p>The below query scans 100 mb of data.</p>
  
  <pre><code>select * from table where column1 = 'val' and partition_id = '20190309';
  </code></pre>
  
  <p>However the below query scans 15 GB of data (there are over 90 partitions)</p>
  
  <pre><code>select * from table where column1 = 'val' and partition_id in (select max(partition_id) from table);
  </code></pre>
  
  <p>How can I optimize the second query to scan the same amount of data as the first?</p>