explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FByUy

Settings
# exclusive inclusive rows x rows loops node
1. 0.098 147,079.283 ↓ 3.0 3 1

GroupAggregate (cost=119,034.13..119,034.17 rows=1 width=215) (actual time=147,079.269..147,079.283 rows=3 loops=1)

  • Group Key: payees.payee, (concat(policies.agent_id, '_2020-06-30_override_split_partner'))
2. 0.247 147,079.185 ↓ 66.0 66 1

Sort (cost=119,034.13..119,034.14 rows=1 width=60) (actual time=147,079.168..147,079.185 rows=66 loops=1)

  • Sort Key: payees.payee, (concat(policies.agent_id, '_2020-06-30_override_split_partner'))
  • Sort Method: quicksort Memory: 34kB
3. 60.824 147,078.938 ↓ 66.0 66 1

Nested Loop (cost=0.00..119,034.12 rows=1 width=60) (actual time=11,813.260..147,078.938 rows=66 loops=1)

  • Join Filter: (partners.payee_id = payees.id)
  • Rows Removed by Join Filter: 261,558
4. 17,491.359 146,916.672 ↓ 66.0 66 1

Nested Loop (cost=0.00..118,745.93 rows=1 width=21) (actual time=11,810.810..146,916.672 rows=66 loops=1)

  • Join Filter: (policies.id = commission_payments.policy_number)
  • Rows Removed by Join Filter: 76,280,229
5. 16.069 199.167 ↓ 609.0 609 1

Nested Loop (cost=0.00..32,256.19 rows=1 width=20) (actual time=1.814..199.167 rows=609 loops=1)

  • Join Filter: (policies.agent_id = partners.agent_id)
  • Rows Removed by Join Filter: 45,675
6. 2.454 166.655 ↓ 609.0 609 1

Nested Loop Semi Join (cost=0.00..32,250.85 rows=1 width=20) (actual time=1.765..166.655 rows=609 loops=1)

  • Join Filter: (policies.agent_id = partners_1.agent_id)
  • Rows Removed by Join Filter: 1,568
7. 162.983 162.983 ↓ 7.7 609 1

Seq Scan on policies (cost=0.00..32,124.50 rows=79 width=12) (actual time=1.731..162.983 rows=609 loops=1)

  • Filter: (((submission_date)::date > '2018-10-31'::date) AND (submitted = 'Yes'::text) AND ((policy_type)::text = 'U65 IMM on-exchange'::text) AND ((npn_reason ~~ 'healthsherpa'::text) OR (npn_reason ~~ 'healthsherpa_as_affiliate'::text)) AND (agent_id = ANY ('{40953,41416,41989,40306,57859,59719,31999}'::bigint[])))
  • Rows Removed by Filter: 211,455
8. 1.198 1.218 ↑ 25.8 4 609

Materialize (cost=0.00..4.55 rows=103 width=8) (actual time=0.001..0.002 rows=4 loops=609)

9. 0.020 0.020 ↑ 14.7 7 1

Seq Scan on partners partners_1 (cost=0.00..4.04 rows=103 width=8) (actual time=0.014..0.020 rows=7 loops=1)

  • Filter: (partner_split_exists IS NOT NULL)
  • Rows Removed by Filter: 69
10. 16.443 16.443 ↑ 1.4 76 609

Seq Scan on partners (cost=0.00..4.04 rows=104 width=16) (actual time=0.004..0.027 rows=76 loops=609)

11. 129,226.146 129,226.146 ↓ 1.2 125,255 609

Seq Scan on commission_payments (cost=0.00..85,153.76 rows=106,878 width=9) (actual time=0.010..212.194 rows=125,255 loops=609)

  • Filter: ((agent_paid IS NOT TRUE) AND (commission_type__c = 'Override'::text))
  • Rows Removed by Filter: 688,178
12. 101.442 101.442 ↑ 1.0 3,964 66

Seq Scan on payees (cost=0.00..238.64 rows=3,964 width=23) (actual time=0.003..1.537 rows=3,964 loops=66)

  • Filter: (payee IS NOT NULL)
Planning time : 0.828 ms