explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GlHC

Settings
# exclusive inclusive rows x rows loops node
1. 0.067 10,241.012 ↓ 1.5 15 1

Limit (cost=399,142.28..399,142.36 rows=10 width=24) (actual time=10,240.940..10,241.012 rows=15 loops=1)

2. 0.006 10,240.945 ↓ 1.5 15 1

Unique (cost=399,142.28..399,142.36 rows=10 width=24) (actual time=10,240.939..10,240.945 rows=15 loops=1)

3. 0.328 10,240.939 ↓ 1.5 15 1

Sort (cost=399,142.28..399,142.31 rows=10 width=24) (actual time=10,240.937..10,240.939 rows=15 loops=1)

  • Sort Key: "Order".order_date DESC, "Order".order_uid
  • Sort Method: quicksort Memory: 70kB
4. 206.560 10,240.611 ↓ 58.6 586 1

Gather (cost=263,608.07..399,142.12 rows=10 width=24) (actual time=5,437.628..10,240.611 rows=586 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 109.220 10,034.051 ↓ 48.8 195 3

Nested Loop Left Join (cost=262,608.07..398,141.12 rows=4 width=24) (actual time=5,401.017..10,034.051 rows=195 loops=3)

6. 15.392 9,924.271 ↓ 48.8 195 3

Nested Loop Left Join (cost=262,607.65..398,138.14 rows=4 width=24) (actual time=5,398.783..9,924.271 rows=195 loops=3)

7. 2,941.156 9,908.800 ↓ 48.2 193 3

Nested Loop (cost=262,607.23..398,136.21 rows=4 width=24) (actual time=5,398.769..9,908.800 rows=193 loops=3)

  • Join Filter: (("Order".order_uid = structure.order_uid) AND (("Order".person_id = '160d76cb-cb29-4657-9314-8e0285a54f2a'::uuid) OR ((structure.structure_code = 3179) AND (structure.structure_type_id = 3))))
  • Rows Removed by Join Filter: 349077
8. 2,776.371 6,967.623 ↓ 1.4 116,629 3

Hash Join (cost=262,606.80..337,292.39 rows=83,240 width=56) (actual time=4,669.413..6,967.623 rows=116,629 loops=3)

  • Hash Cond: (delivery.order_uid = "Order".order_uid)
9. 1,044.158 1,044.158 ↑ 1.3 845,182 3

Parallel Seq Scan on delivery_mode delivery (cost=0.00..59,878.13 rows=1,071,413 width=16) (actual time=0.005..1,044.158 rows=845,182 loops=3)

10. 876.450 3,147.094 ↓ 1.8 349,886 3

Hash (cost=258,626.42..258,626.42 rows=195,950 width=40) (actual time=3,147.094..3,147.094 rows=349,886 loops=3)

  • Buckets: 65536 (originally 65536) Batches: 8 (originally 4) Memory Usage: 3593kB
11. 2,270.644 2,270.644 ↓ 1.8 349,886 3

Index Scan using order_order_number_idx on "order" "Order" (cost=0.43..258,626.42 rows=195,950 width=40) (actual time=0.010..2,270.644 rows=349,886 loops=3)

  • Index Cond: (order_number <= 30755313)
  • Filter: ((order_date >= '2018-11-06 00:00:00+00'::timestamp with time zone) AND (order_date <= '2019-11-06 23:59:59.999+00'::timestamp with time zone) AND (business_model_id = 1) AND (company_id = 1) AND ((country_code)::text = 'PE'::text))
  • Rows Removed by Filter: 32054
12. 0.021 0.021 ↑ 1.0 3 349,886

Index Scan using order_order_structure_fk on order_structure structure (cost=0.43..0.67 rows=3 width=24) (actual time=0.018..0.021 rows=3 loops=349,886)

  • Index Cond: (order_uid = delivery.order_uid)
13. 0.079 0.079 ↓ 0.0 0 578

Index Only Scan using order_order_pending_reason_fk on order_pending_reason reason (cost=0.42..0.47 rows=1 width=16) (actual time=0.079..0.079 rows=0 loops=578)

  • Index Cond: (order_uid = "Order".order_uid)
  • Heap Fetches: 20
14. 0.560 0.560 ↑ 1.0 1 586

Index Only Scan using order_order_payment_fk on order_payment payment (cost=0.42..0.74 rows=1 width=16) (actual time=0.560..0.560 rows=1 loops=586)

  • Index Cond: (order_uid = "Order".order_uid)
  • Heap Fetches: 180
Planning time : 2.509 ms
Execution time : 10,241.104 ms