title: ActiveRecord::QueryCanceled: PG::QueryCanceled: ERROR: canceling statement due to statement timeout when query Ahoy Event
body: <p>I have a query like this with <code>Ahoy</code> gem:</p>
  <pre class="lang-rb prettyprint-override"><code>Ahoy::Event.where_event('Ran action').group_by_week(:time).where_props(
    event_id: current_event.id
  ).count
  </code></pre>
  <p>but get error message like below:</p>
  <pre><code>ActiveRecord::QueryCanceled: PG::QueryCanceled: ERROR:  canceling statement due to statement timeout
  </code></pre>
  <p>I'm thinking it because the database is too big so it take too long to query. I have used <code>find_in_batches</code> to fix but it seem to be not the right path.</p>
  <p>I'm very bad at SQL so this is really a headache. Any help is appreciate.</p>