explain.depesz.com

PostgreSQL's explain analyze made readable

Result: K80D

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,087.524 ↓ 0.0 0 1

Nested Loop Left Join (cost=4,888.56..12,445.34 rows=4 width=90) (actual time=3,087.524..3,087.524 rows=0 loops=1)

2. 0.001 3,087.524 ↓ 0.0 0 1

Nested Loop Left Join (cost=4,888.29..12,444.09 rows=4 width=60) (actual time=3,087.524..3,087.524 rows=0 loops=1)

3. 0.770 3,087.523 ↓ 0.0 0 1

Nested Loop Left Join (cost=4,888.00..12,440.43 rows=4 width=60) (actual time=3,087.523..3,087.523 rows=0 loops=1)

  • Filter: (cm.send_at IS NULL)
  • Rows Removed by Filter: 1,069
4. 106.193 3,061.751 ↓ 2.8 926 1

Nested Loop Left Join (cost=4,887.58..10,897.31 rows=329 width=52) (actual time=2,331.206..3,061.751 rows=926 loops=1)

  • Filter: (dg.postivo_result IS NULL)
  • Rows Removed by Filter: 6,147
5. 316.445 2,630.200 ↓ 1.2 7,073 1

Hash Right Join (cost=4,887.29..6,843.65 rows=5,847 width=53) (actual time=2,331.200..2,630.200 rows=7,073 loops=1)

  • Hash Cond: (dr.payment_id = p.payment_id)
6. 75.772 75.772 ↑ 1.0 83,594 1

Seq Scan on dispatch_rows dr (cost=0.00..1,586.45 rows=83,845 width=8) (actual time=0.006..75.772 rows=83,594 loops=1)

7. 120.091 2,237.983 ↓ 1.2 7,073 1

Hash (cost=4,814.20..4,814.20 rows=5,847 width=49) (actual time=2,237.983..2,237.983 rows=7,073 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 672kB
8. 2,117.892 2,117.892 ↓ 1.2 7,073 1

Seq Scan on payments p (cost=0.00..4,814.20 rows=5,847 width=49) (actual time=0.258..2,117.892 rows=7,073 loops=1)

  • Filter: (pdf_exists AND (NOT print_psi) AND to_send AND ((invoice_number)::text !~~* '%/HT/%'::text) AND (company_id = 11) AND (created_at >= (now() - '30 days'::interval)))
  • Rows Removed by Filter: 81,247
9. 325.358 325.358 ↑ 1.0 1 7,073

Index Scan using dispatch_groups_dispatch_group_id_index on dispatch_groups dg (cost=0.29..0.68 rows=1 width=7) (actual time=0.040..0.046 rows=1 loops=7,073)

  • Index Cond: (dr.dispatch_group_id = dispatch_group_id)
10. 25.002 25.002 ↑ 1.0 1 926

Index Scan using client_messages_external_payment_id_index on client_messages cm (cost=0.42..4.68 rows=1 width=15) (actual time=0.027..0.027 rows=1 loops=926)

  • Index Cond: ((external_payment_id)::text = (p.external_id)::text)
11. 0.000 0.000 ↓ 0.0 0

Index Only Scan using clients_client_id_index on clients c (cost=0.29..0.91 rows=1 width=4) (never executed)

  • Index Cond: (client_id = p.client_id)
  • Heap Fetches: 0
12. 0.000 0.000 ↓ 0.0 0

Index Scan using einvoice_accept_client_id_index on einvoice_accept ea (cost=0.28..0.30 rows=1 width=34) (never executed)

  • Index Cond: (c.client_id = client_id)
  • Filter: accept_complete
Planning time : 1.246 ms
Execution time : 3,087.626 ms