explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iUdW : Optimization for: Optimization for: plan #uB1; plan #hi0S

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 1,965.944 ↓ 73.0 73 1

Nested Loop (cost=1,000.85..52,414.89 rows=1 width=1,162) (actual time=353.201..1,965.944 rows=73 loops=1)

2. 4.685 1,962.647 ↓ 74.0 74 1

Gather (cost=1,000.42..52,409.59 rows=1 width=1,162) (actual time=349.430..1,962.647 rows=74 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
3. 1,694.039 1,957.962 ↓ 18.0 18 4

Nested Loop (cost=0.42..51,409.49 rows=1 width=1,162) (actual time=421.744..1,957.962 rows=18 loops=4)

4. 263.414 263.414 ↑ 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=22.749..263.414 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. 0.509 0.509 ↓ 0.0 0 13,281

Index Scan using reminder_mail_log_invoice_id_idx on reminder_mail_log rml (cost=0.42..4.75 rows=1 width=1,158) (actual time=0.509..0.509 rows=0 loops=13,281)

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

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.049..0.051 rows=1 loops=74)

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