explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QCIS

Settings
# exclusive inclusive rows x rows loops node
1. 0.034 69,244.679 ↓ 2.0 2 1

Sort (cost=2,483.70..2,483.70 rows=1 width=436) (actual time=69,244.678..69,244.679 rows=2 loops=1)

  • Sort Key: p.invoice_date DESC
  • Sort Method: quicksort Memory: 26kB
2. 0.023 69,244.645 ↓ 2.0 2 1

Nested Loop (cost=87.82..2,483.69 rows=1 width=436) (actual time=9,947.569..69,244.645 rows=2 loops=1)

3. 35.863 69,244.574 ↓ 2.0 2 1

Nested Loop Left Join (cost=87.52..2,483.18 rows=1 width=359) (actual time=9,947.520..69,244.574 rows=2 loops=1)

  • Filter: (cm.client_message_id IS NULL)
  • Rows Removed by Filter: 2,410
4. 32.088 1,468.999 ↓ 1,198.0 2,396 1

Nested Loop (cost=87.10..2,444.10 rows=2 width=359) (actual time=1.040..1,468.999 rows=2,396 loops=1)

5. 73.775 1,216.051 ↓ 409.0 2,454 1

Nested Loop (cost=86.81..2,441.36 rows=6 width=355) (actual time=1.034..1,216.051 rows=2,454 loops=1)

  • Join Filter: (c.client_id = p.client_id)
6. 26.347 229.992 ↓ 217.6 1,741 1

Hash Join (cost=86.39..2,367.96 rows=8 width=108) (actual time=1.003..229.992 rows=1,741 loops=1)

  • Hash Cond: (c.client_id = ea.client_id)
7. 202.682 202.682 ↓ 10.3 1,738 1

Seq Scan on clients c (cost=0.00..2,280.02 rows=168 width=75) (actual time=0.019..202.682 rows=1,738 loops=1)

  • Filter: (einvoice_enable AND (nicepay_account_id IS NOT NULL))
  • Rows Removed by Filter: 31,164
8. 0.327 0.963 ↓ 1.2 1,754 1

Hash (cost=67.48..67.48 rows=1,513 width=33) (actual time=0.963..0.963 rows=1,754 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 134kB
9. 0.636 0.636 ↓ 1.2 1,754 1

Seq Scan on einvoice_accept ea (cost=0.00..67.48 rows=1,513 width=33) (actual time=0.027..0.636 rows=1,754 loops=1)

  • Filter: (accept_complete AND accept_complete)
  • Rows Removed by Filter: 237
10. 912.284 912.284 ↑ 1.0 1 1,741

Index Scan using payments_client_id_index on payments p (cost=0.42..9.16 rows=1 width=263) (actual time=0.186..0.524 rows=1 loops=1,741)

  • Index Cond: (client_id = ea.client_id)
  • Filter: (to_send AND (invoice_date >= '2020-04-23 00:00:00'::timestamp without time zone) AND ((invoice_number)::text !~~* '%/HT/%'::text) AND (company_id = 11) AND (invoice_date > (ea.accepted_at)::date))
  • Rows Removed by Filter: 4
11. 220.860 220.860 ↑ 1.0 1 2,454

Index Scan using dispatch_rows_payment_id_index on dispatch_rows dr (cost=0.29..0.45 rows=1 width=8) (actual time=0.090..0.090 rows=1 loops=2,454)

  • Index Cond: (payment_id = p.payment_id)
  • Filter: ((dispatch_group_id IS NULL) AND (client_message_id IS NULL))
  • Rows Removed by Filter: 0
12. 67,739.712 67,739.712 ↑ 1.0 1 2,396

Index Scan using clients_messages_company_id_idx on client_messages cm (cost=0.42..19.53 rows=1 width=15) (actual time=15.653..28.272 rows=1 loops=2,396)

  • Index Cond: ((company_id = p.company_id) AND (company_id = 11))
  • Filter: (((message_type)::text = 'email_new_payment'::text) AND ((p.external_id)::text = (external_payment_id)::text))
  • Rows Removed by Filter: 2,726
13. 0.048 0.048 ↑ 1.0 1 2

Index Scan using clients_messages_dispatch_attachments_row_id_idx on dispatch_attachments da (cost=0.29..0.50 rows=1 width=77) (actual time=0.024..0.024 rows=1 loops=2)

  • Index Cond: (dispatch_row_id = dr.dispatch_row_id)
Planning time : 2.030 ms
Execution time : 69,244.878 ms