Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ailabs-software/697f36b47c1fff692c30e2c17eaa78f3 to your computer and use it in GitHub Desktop.
Save ailabs-software/697f36b47c1fff692c30e2c17eaa78f3 to your computer and use it in GitHub Desktop.
1500ms query on 7 million row table
EXPLAIN ANALYZE SELECT page_url, page_title, COUNT(*)::int FROM siteanalytics_pageview
WHERE domain=143 AND ( pageview_timestamp::date >= '7/10/2017'::date AND pageview_timestamp::date <= '8/9/2017'::date )
GROUP BY page_url, page_title ORDER BY count DESC LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment