explain.depesz.com

PostgreSQL's explain analyze made readable

Result: em81

Settings
# exclusive inclusive rows x rows loops node
1. 21.894 16,213.158 ↑ 724.7 15 1

GroupAggregate (cost=266,786.74..267,085.70 rows=10,871 width=48) (actual time=16,178.856..16,213.158 rows=15 loops=1)

  • Group Key: (to_char(am.sent_at, 'YYYY/MM/DD'::text))
2. 134.359 16,191.264 ↓ 14.3 155,247 1

Sort (cost=266,786.74..266,813.92 rows=10,871 width=56) (actual time=16,178.003..16,191.264 rows=155,247 loops=1)

  • Sort Key: (to_char(am.sent_at, 'YYYY/MM/DD'::text)) DESC
  • Sort Method: quicksort Memory: 18,273kB
3. 116.151 16,056.905 ↓ 14.3 155,247 1

Nested Loop (cost=1,511.87..266,057.94 rows=10,871 width=56) (actual time=1.713..16,056.905 rows=155,247 loops=1)

4. 0.030 0.030 ↑ 1.0 1 1

Index Only Scan using legacy_brokerages_pkey on corporate_profiles company (cost=0.29..8.30 rows=1 width=16) (actual time=0.021..0.030 rows=1 loops=1)

  • Index Cond: (id = '894940fb-f3db-4060-84ea-9582305b6d6c'::uuid)
  • Heap Fetches: 3
5. 65.768 15,940.724 ↓ 14.3 155,247 1

Nested Loop (cost=1,511.59..265,913.75 rows=10,871 width=48) (actual time=1.626..15,940.724 rows=155,247 loops=1)

6. 0.000 96.024 ↓ 5.9 404,588 1

Gather (cost=1,511.02..25,836.84 rows=68,971 width=48) (actual time=1.604..96.024 rows=404,588 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 37.659 377.255 ↓ 4.7 134,863 3 / 3

Nested Loop (cost=511.02..17,939.74 rows=28,738 width=48) (actual time=0.807..377.255 rows=134,863 loops=3)

8. 2.817 17.276 ↓ 1.4 632 3 / 3

Hash Join (cost=510.47..6,739.76 rows=456 width=32) (actual time=0.759..17.276 rows=632 loops=3)

  • Hash Cond: (agent.office_profile_id = office.id)
9. 13.809 13.809 ↑ 1.2 21,441 3 / 3

Parallel Seq Scan on customer_profiles agent (cost=0.00..6,158.95 rows=26,795 width=32) (actual time=0.010..13.809 rows=21,441 loops=3)

10. 0.067 0.650 ↑ 1.0 370 3 / 3

Hash (cost=505.84..505.84 rows=370 width=32) (actual time=0.649..0.650 rows=370 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 32kB
11. 0.512 0.583 ↑ 1.0 370 3 / 3

Bitmap Heap Scan on office_profiles office (cost=15.15..505.84 rows=370 width=32) (actual time=0.089..0.583 rows=370 loops=3)

  • Recheck Cond: (corporate_profile_id = '894940fb-f3db-4060-84ea-9582305b6d6c'::uuid)
  • Heap Blocks: exact=185
12. 0.071 0.071 ↓ 1.0 371 3 / 3

Bitmap Index Scan on index_office_profiles_on_corporate_profile_id (cost=0.00..15.06 rows=370 width=0) (actual time=0.071..0.071 rows=371 loops=3)

  • Index Cond: (corporate_profile_id = '894940fb-f3db-4060-84ea-9582305b6d6c'::uuid)
13. 322.320 322.320 ↑ 2.0 213 1,896 / 3

Index Scan using index_clients_on_customer_profile_id_and_email on clients client (cost=0.56..20.39 rows=417 width=32) (actual time=0.012..0.510 rows=213 loops=1,896)

  • Index Cond: (customer_profile_id = agent.id)
14. 15,778.932 15,778.932 ↓ 0.0 0 404,588

Index Scan using index_ahoy_messages_on_user_id_and_user_type on ahoy_messages am (cost=0.56..3.47 rows=1 width=32) (actual time=0.026..0.039 rows=0 loops=404,588)

  • Index Cond: ((user_id = client.id) AND ((user_type)::text = 'Client'::text))
  • Filter: (((mailer)::text = 'HomeownerMailer#home_digest'::text) AND ((sent_at)::date <= (now())::date) AND ((sent_at)::date >= ((now() + '-14 days'::interval))::date))
  • Rows Removed by Filter: 15
Planning time : 1.069 ms
Execution time : 16,214.570 ms