title: Can you index on timestamp difference between tables in PostgreSQL?
body: <p>I have two tables, Users and Transactions. In both tables, rows have a timestamp.</p>
  
  <p>I am running into performance issues when running complex queries where the transaction dates are being normalized to reflect at what point of a user experience they happened (i.e. how many days after a user joined was the transaction processed).</p>
  
  <p>This "normalized day" measure is calculated as</p>
  
  <pre><code>ceil(extract(days from T.tdate - U.created_at)) +1
  </code></pre>
  
  <p>Is there any way to index this such that I can increase the speed of the query?</p>