explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ULDd

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 2,205.398 ↓ 0.0 0 1

Sort (cost=12,445.39..12,445.40 rows=4 width=91) (actual time=2,205.398..2,205.398 rows=0 loops=1)

  • Sort Key: ((p.invoice_date > ea.accepted_at)) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.000 2,205.391 ↓ 0.0 0 1

Nested Loop Left Join (cost=4,888.56..12,445.35 rows=4 width=91) (actual time=2,205.391..2,205.391 rows=0 loops=1)

3. 0.001 2,205.391 ↓ 0.0 0 1

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

4. 0.368 2,205.390 ↓ 0.0 0 1

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

  • Filter: (cm.send_at IS NULL)
  • Rows Removed by Filter: 1,069
5. 4.031 2,199.466 ↓ 2.8 926 1

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

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

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

  • Hash Cond: (dr.payment_id = p.payment_id)
7. 19.860 19.860 ↑ 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..19.860 rows=83,594 loops=1)

8. 8.872 2,112.333 ↓ 1.2 7,073 1

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

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

Seq Scan on payments p (cost=0.00..4,814.20 rows=5,847 width=49) (actual time=0.267..2,103.461 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
10. 14.146 14.146 ↑ 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.002..0.002 rows=1 loops=7,073)

  • Index Cond: (dr.dispatch_group_id = dispatch_group_id)
11. 5.556 5.556 ↑ 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.005..0.006 rows=1 loops=926)

  • Index Cond: ((external_payment_id)::text = (p.external_id)::text)
12. 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
13. 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.237 ms
Execution time : 2,205.499 ms