explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QTRv

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

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

2. 0.001 3,818.994 ↓ 0.0 0 1

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

3. 0.038 3,818.993 ↓ 0.0 0 1

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

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

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

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

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

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

7. 2.285 2,497.152 ↓ 1.2 7,073 1

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

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

Seq Scan on payments p (cost=0.00..4,814.20 rows=5,847 width=49) (actual time=0.224..2,494.867 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. 396.088 396.088 ↑ 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.045..0.056 rows=1 loops=7,073)

  • Index Cond: (dr.dispatch_group_id = dispatch_group_id)
10. 326.878 326.878 ↑ 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.266..0.353 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.159 ms
Execution time : 3,819.107 ms