explain.depesz.com

PostgreSQL's explain analyze made readable

Result: b5b0 : Optimization for: plan #6uj5

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 14,412.166 ↑ 20.0 1 1

Limit (cost=1,002.28..7,570.72 rows=20 width=4,093) (actual time=14,412.164..14,412.166 rows=1 loops=1)

  • Buffers: shared hit=13,704,219
2. 5.686 14,413.130 ↑ 15,980.0 1 1

Gather Merge (cost=1,002.28..5,249,187.79 rows=15,980 width=4,093) (actual time=14,412.163..14,413.13 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=41,514,084
3. 0.005 14,407.444 ↓ 0.0 0 3 / 3

Nested Loop (cost=2.25..5,246,343.27 rows=6,658 width=4,093) (actual time=10,333.475..14,407.444 rows=0 loops=3)

  • Buffers: shared hit=41,514,084
4. 2,319.156 14,407.431 ↓ 0.0 0 3 / 3

Nested Loop (cost=1.82..5,242,437.07 rows=6,658 width=3,471) (actual time=10,333.462..14,407.431 rows=0 loops=3)

  • Filter: ((upper((cards_order.uid)::text) ~~ 'A'::text) OR ((customers_customer.email)::text ~~ 'A'::text) OR ((t3.email)::text ~~ 'A'::text) OR ((billing_invoice.number)::text ~~ 'A'::text) OR ((cards_order.client_reference)::text ~~ 'A'::text))
  • Buffers: shared hit=41,514,079
5. 1,926.244 9,962.596 ↑ 1.3 1,062,840 3 / 3

Nested Loop (cost=1.41..4,610,767.38 rows=1,329,164 width=2,671) (actual time=0.077..9,962.596 rows=1,062,840 loops=3)

  • Buffers: shared hit=28,759,458
6. 1,963.130 5,910.673 ↑ 1.3 1,062,840 3 / 3

Nested Loop (cost=0.98..3,697,781.53 rows=1,329,164 width=2,274) (actual time=0.043..5,910.673 rows=1,062,840 loops=3)

  • Buffers: shared hit=16,077,109
7. 1,821.864 1,821.864 ↑ 1.3 1,062,840 3 / 3

Index Scan using cards_order_created_af7f23_idx on cards_order cards_order (cost=0.56..3,099,340.8 rows=1,329,164 width=1,474) (actual time=0.022..1,821.864 rows=1,062,840 loops=3)

  • Buffers: shared hit=3,328,533
8. 2,125.679 2,125.679 ↑ 1.0 1 3,188,519 / 3

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

  • Index Cond: (cards_order.created_by_id = customers_customer.id)
  • Buffers: shared hit=12,748,576
9. 2,125.679 2,125.679 ↑ 1.0 1 3,188,519 / 3

Index Scan using billing_invoice_pkey on billing_invoice billing_invoice (cost=0.43..0.69 rows=1 width=397) (actual time=0.002..0.002 rows=1 loops=3,188,519)

  • Index Cond: (cards_order.invoice_id = billing_invoice.id)
  • Buffers: shared hit=12,682,349
10. 2,125.679 2,125.679 ↑ 1.0 1 3,188,519 / 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,188,519)

  • Index Cond: (cards_order.customer_id = t3.id)
  • Buffers: shared hit=12,754,621
11. 0.008 0.008 ↑ 1.0 1 1 / 3

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

  • Index Cond: (billing_invoice.payment_id = billing_payment.id)
  • Buffers: shared hit=5
Planning time : 1.605 ms
Execution time : 14,413.339 ms