explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MV6y

Settings
# exclusive inclusive rows x rows loops node
1. 0.411 1,932.602 ↓ 4.7 878 1

GroupAggregate (cost=48,397.07..48,400.31 rows=185 width=12) (actual time=1,931.894..1,932.602 rows=878 loops=1)

  • Group Key: mailgun_events.subscriber_id
2. 3.048 1,932.191 ↓ 13.6 2,514 1

Sort (cost=48,397.07..48,397.53 rows=185 width=4) (actual time=1,931.885..1,932.191 rows=2,514 loops=1)

  • Sort Key: mailgun_events.subscriber_id
  • Sort Method: quicksort Memory: 214kB
3. 3.265 1,929.143 ↓ 13.6 2,514 1

Nested Loop (cost=3,963.58..48,390.10 rows=185 width=4) (actual time=7.990..1,929.143 rows=2,514 loops=1)

4. 2.535 9.878 ↑ 1.0 1,000 1

HashAggregate (cost=3,963.01..3,973.01 rows=1,000 width=4) (actual time=7.849..9.878 rows=1,000 loops=1)

  • Group Key: subscribers.id
5. 0.147 7.343 ↑ 1.0 1,000 1

Limit (cost=0.56..3,950.51 rows=1,000 width=4) (actual time=0.106..7.343 rows=1,000 loops=1)

6. 7.196 7.196 ↑ 204.7 1,000 1

Index Scan using index_subscribers_on_store_id_and_subscribed on subscribers (cost=0.56..808,478.93 rows=204,681 width=4) (actual time=0.104..7.196 rows=1,000 loops=1)

  • Index Cond: (store_id = 4,318)
7. 1,916.000 1,916.000 ↓ 3.0 3 1,000

Index Scan using index_mailgun_events_on_store_id_and_subscriber_id on mailgun_events (cost=0.57..44.41 rows=1 width=4) (actual time=1.181..1.916 rows=3 loops=1,000)

  • Index Cond: ((store_id = 4,318) AND (subscriber_id = subscribers.id))
  • Filter: ((event)::text = 'clicked'::text)
  • Rows Removed by Filter: 103
Planning time : 0.594 ms
Execution time : 1,932.774 ms