explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hi0S : Optimization for: plan #uB1

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 7,795.325 ↓ 116.0 116 1

Nested Loop (cost=1,000.85..52,473.16 rows=1 width=1,162) (actual time=2,377.497..7,795.325 rows=116 loops=1)

2. 0.000 7,754.732 ↓ 117.0 117 1

Gather (cost=1,000.42..52,467.87 rows=1 width=1,162) (actual time=2,377.477..7,754.732 rows=117 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
3. 5,878.824 7,770.032 ↓ 29.0 29 4

Nested Loop (cost=0.42..51,467.77 rows=1 width=1,162) (actual time=2,381.323..7,770.032 rows=29 loops=4)

4. 1,889.438 1,889.438 ↑ 1.4 3,320 4

Parallel Seq Scan on payment_outstanding po (cost=0.00..29,199.84 rows=4,662 width=8) (actual time=21.754..1,889.438 rows=3,320 loops=4)

  • Filter: (active AND (outstanding_amount > '0'::double precision) AND (entity_type = 'invoice'::payment_outstanding_entity_type))
  • Rows Removed by Filter: 434786
5. 1.770 1.770 ↓ 0.0 0 13,280

Index Scan using reminder_mail_log_invoice_id_idx on reminder_mail_log rml (cost=0.42..4.77 rows=1 width=1,158) (actual time=1.769..1.770 rows=0 loops=13,280)

  • Index Cond: (invoice_id = po.invoice_payment_note_id)
  • Filter: (active AND (po.client_code_id = client_code_id) AND ((status)::integer <> 3) AND ((((reminder_1 ->> 'sent_date'::text) < '2019-08-13 23:59:59'::text) AND ((status)::integer = 0)) OR (((reminder_2 ->> 'sent_date'::text) < '2019-08-13 23:59:59'::text) AND ((status)::integer = 1))))
  • Rows Removed by Filter: 1
6. 41.184 41.184 ↑ 1.0 1 117

Index Scan using eos_user_client_code_id_index on eos_user eos (cost=0.42..5.28 rows=1 width=8) (actual time=0.351..0.352 rows=1 loops=117)

  • Index Cond: (client_code_id = po.client_code_id)
  • Filter: (active AND ((roles -> 'roles'::text) @> '["23"]'::jsonb))
  • Rows Removed by Filter: 0
Planning time : 14.854 ms
Execution time : 7,796.324 ms