Skip to content

Instantly share code, notes, and snippets.

@nicpottier
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicpottier/6c3cab7fff0b09722673 to your computer and use it in GitHub Desktop.
Save nicpottier/6c3cab7fff0b09722673 to your computer and use it in GitHub Desktop.
explain analyze select count(*) from msgs_msg where org_id=2 and visibility='V' and direction='I' and msg_type='I';
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=315633.66..315633.67 rows=1 width=0) (actual time=34491.919..34491.920 rows=1 loops=1)
-> Index Only Scan using msg_visibility_direction_type_created_inbound on msgs_msg (cost=0.56..315328.62 rows=122015 width=0) (actual time=1.668..34384.518 rows=252775 loops=1)
Index Cond: ((org_id = 2) AND (visibility = 'V'::text) AND (direction = 'I'::text) AND (msg_type = 'I'::text))
Heap Fetches: 252775
Total runtime: 34491.989 ms
(5 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment