explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yZDH

Settings
# exclusive inclusive rows x rows loops node
1. 1,016.793 18,119.603 ↑ 39,390.0 1 1

Gather Merge (cost=2,817,101.38..2,821,697.2 rows=39,390 width=4,092) (actual time=17,107.842..18,119.603 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=26,164,996 dirtied=1, temp read=481,875 written=482,360
2. 0.031 17,102.810 ↓ 0.0 0 3 / 3

Sort (cost=2,816,101.36..2,816,150.6 rows=19,695 width=4,092) (actual time=17,102.809..17,102.81 rows=0 loops=3)

  • Sort Key: cards_order.created_at DESC, cards_order.id DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=26,164,996 dirtied=1, temp read=481,875 written=482,360
3. 0.003 17,102.779 ↓ 0.0 0 3 / 3

Nested Loop (cost=270,098.28..2,780,025.56 rows=19,695 width=4,092) (actual time=16,215.232..17,102.779 rows=0 loops=3)

  • Buffers: shared hit=26,164,968 dirtied=1, temp read=481,875 written=482,360
4. 3,758.199 17,102.770 ↓ 0.0 0 3 / 3

Nested Loop (cost=270,097.85..2,768,441.54 rows=19,695 width=3,472) (actual time=16,215.223..17,102.77 rows=0 loops=3)

  • Filter: ((upper((cards_order.uid)::text) ~~ 'A'::text) OR (upper((customers_customer.email)::text) ~~ 'A'::text) OR (upper((t3.email)::text) ~~ 'A'::text) OR (upper((billing_invoice.number)::text) ~~ 'A'::text) OR (upper((cards_order.client_reference)::text) ~~ 'A'::text))
  • Buffers: shared hit=26,164,963 dirtied=1, temp read=481,875 written=482,360
5. 1,042.404 11,236.146 ↑ 1.3 1,054,212 3 / 3

Nested Loop (cost=270,097.43..2,128,375.65 rows=1,318,814 width=2,672) (actual time=5,248.095..11,236.146 rows=1,054,212 loops=3)

  • Buffers: shared hit=13,513,871 dirtied=1, temp read=481,875 written=482,360
6. 3,990.158 7,031.105 ↑ 1.3 1,054,212 3 / 3

Hash Join (cost=270,097.01..1,534,468.04 rows=1,318,814 width=1,872) (actual time=5,248.066..7,031.105 rows=1,054,212 loops=3)

  • Buffers: shared hit=868,824, temp read=481,875 written=482,360
7. 1,016.912 1,016.912 ↑ 1.3 1,054,212 3 / 3

Seq Scan on cards_order cards_order (cost=0..708,969.14 rows=1,318,814 width=1,475) (actual time=0.008..1,016.912 rows=1,054,212 loops=3)

  • Buffers: shared hit=695,781
8. 1,263.972 2,024.035 ↑ 1.2 1,050,507 3 / 3

Hash (cost=186,064.34..186,064.34 rows=1,307,734 width=397) (actual time=2,024.035..2,024.035 rows=1,050,507 loops=3)

  • Buffers: shared hit=172,987, temp written=147,900
9. 760.063 760.063 ↑ 1.2 1,050,507 3 / 3

Seq Scan on billing_invoice billing_invoice (cost=0..186,064.34 rows=1,307,734 width=397) (actual time=0.007..760.063 rows=1,050,507 loops=3)

  • Buffers: shared hit=172,987
10. 3,162.637 3,162.637 ↑ 1.0 1 3,162,637 / 3

Index Scan using customers_customer_pkey on customers_customer customers_customer (cost=0.42..0.45 rows=1 width=800) (actual time=0.003..0.003 rows=1 loops=3,162,637)

  • Index Cond: (cards_order.created_by_id = customers_customer.id)
  • Buffers: shared hit=12,645,047 dirtied=1
11. 2,108.425 2,108.425 ↑ 1.0 1 3,162,637 / 3

Index Scan using customers_customer_pkey on customers_customer t3 (cost=0.42..0.45 rows=1 width=800) (actual time=0.002..0.002 rows=1 loops=3,162,637)

  • Index Cond: (cards_order.customer_id = t3.id)
  • Buffers: shared hit=12,651,092
12. 0.006 0.006 ↑ 1.0 1 1 / 3

Index Scan using billing_payment_pkey on billing_payment billing_payment (cost=0.43..0.59 rows=1 width=608) (actual time=0.018..0.018 rows=1 loops=1)

  • Index Cond: (billing_invoice.payment_id = billing_payment.id)
  • Buffers: shared hit=5
Planning time : 1.124 ms
Execution time : 18,121.811 ms