explain.depesz.com

PostgreSQL's explain analyze made readable

Result: z5N2

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 310.845 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,447.56..248,494.51 rows=2 width=1,216) (actual time=310.845..310.845 rows=0 loops=1)

2. 0.001 310.845 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,446.04..248,490.60 rows=1 width=1,121) (actual time=310.845..310.845 rows=0 loops=1)

3. 0.001 310.844 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,445.62..248,482.15 rows=1 width=1,094) (actual time=310.844..310.844 rows=0 loops=1)

4. 0.000 310.843 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,445.20..248,481.29 rows=1 width=1,063) (actual time=310.843..310.843 rows=0 loops=1)

5. 0.000 310.843 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,445.06..248,473.13 rows=1 width=1,032) (actual time=310.843..310.843 rows=0 loops=1)

6. 0.001 310.843 ↓ 0.0 0 1

Nested Loop (cost=248,444.64..248,464.68 rows=1 width=1,001) (actual time=310.843..310.843 rows=0 loops=1)

7. 0.000 310.842 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,444.35..248,456.36 rows=1 width=972) (actual time=310.842..310.842 rows=0 loops=1)

8. 0.001 310.842 ↓ 0.0 0 1

Nested Loop (cost=248,443.93..248,447.91 rows=1 width=941) (actual time=310.842..310.842 rows=0 loops=1)

9. 0.000 310.841 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,443.64..248,447.19 rows=1 width=910) (actual time=310.841..310.841 rows=0 loops=1)

10. 0.013 310.841 ↓ 0.0 0 1

Hash Right Join (cost=248,443.51..248,447.03 rows=1 width=764) (actual time=310.841..310.841 rows=0 loops=1)

  • Hash Cond: ((ec.expensesclauseid)::integer = (o.expensesclauseid)::integer)
11. 0.000 0.000 ↓ 0.0 0

Seq Scan on expensesclauses ec (cost=0.00..3.10 rows=110 width=68) (never executed)

12. 0.000 310.828 ↓ 0.0 0 1

Hash (cost=248,443.49..248,443.49 rows=1 width=700) (actual time=310.828..310.828 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
13. 0.011 310.828 ↓ 0.0 0 1

Hash Join (cost=248,442.44..248,443.49 rows=1 width=700) (actual time=310.828..310.828 rows=0 loops=1)

  • Hash Cond: ((oc.currencyid)::integer = (o.currencyid)::integer)
14. 0.005 0.005 ↑ 3.0 1 1

Seq Scan on currencies oc (cost=0.00..1.03 rows=3 width=200) (actual time=0.005..0.005 rows=1 loops=1)

15. 0.000 310.812 ↓ 0.0 0 1

Hash (cost=248,442.43..248,442.43 rows=1 width=504) (actual time=310.812..310.812 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
16. 0.000 310.812 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,406.97..248,442.43 rows=1 width=504) (actual time=310.812..310.812 rows=0 loops=1)

17. 0.000 310.812 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,406.83..248,442.26 rows=1 width=358) (actual time=310.812..310.812 rows=0 loops=1)

18. 0.001 310.812 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,406.41..248,433.82 rows=1 width=336) (actual time=310.812..310.812 rows=0 loops=1)

19. 0.000 310.811 ↓ 0.0 0 1

Nested Loop Left Join (cost=248,406.28..248,433.65 rows=1 width=190) (actual time=310.811..310.811 rows=0 loops=1)

20. 0.001 310.811 ↓ 0.0 0 1

Nested Loop (cost=248,405.86..248,425.20 rows=1 width=190) (actual time=310.811..310.811 rows=0 loops=1)

21. 0.000 310.810 ↓ 0.0 0 1

Nested Loop (cost=248,405.43..248,416.74 rows=1 width=186) (actual time=310.810..310.810 rows=0 loops=1)

22. 0.015 310.810 ↓ 0.0 0 1

Hash Join (cost=248,405.14..248,408.42 rows=1 width=170) (actual time=310.810..310.810 rows=0 loops=1)

  • Hash Cond: ((oos.stateid)::integer = (o.stateid)::integer)
23. 0.007 0.007 ↑ 93.0 1 1

Seq Scan on states oos (cost=0.00..2.93 rows=93 width=31) (actual time=0.007..0.007 rows=1 loops=1)

24. 0.001 310.788 ↓ 0.0 0 1

Hash (cost=248,405.12..248,405.12 rows=1 width=147) (actual time=310.788..310.788 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
25. 0.287 310.787 ↓ 0.0 0 1

Index Scan using i_orders_orderidobjectstatusid on orders o (cost=248,397.10..248,405.12 rows=1 width=147) (actual time=310.787..310.787 rows=0 loops=1)

  • Index Cond: ((orderid)::integer = 2892634)
  • Filter: (isinwork AND (parentorderid IS NULL) AND (hashed SubPlan 1))
  • Rows Removed by Filter: 1
26.          

SubPlan (forIndex Scan)

27. 0.617 310.500 ↓ 58.6 821 1

Nested Loop (cost=142,811.31..248,396.64 rows=14 width=4) (actual time=305.980..310.500 rows=821 loops=1)

28. 1.097 307.420 ↑ 4.8 821 1

Hash Join (cost=142,810.75..219,471.47 rows=3,932 width=8) (actual time=305.960..307.420 rows=821 loops=1)

  • Hash Cond: ((oir.orderid)::integer = (o_1.orderid)::integer)
29. 1.138 1.138 ↑ 180.4 936 1

Index Scan using i_orderitemreserves_4_samples on orderitemreserves oir (cost=0.28..75,988.62 rows=168,813 width=8) (actual time=0.009..1.138 rows=936 loops=1)

  • Filter: ((storegroupid)::integer = 10)
  • Rows Removed by Filter: 437
30. 41.242 305.185 ↓ 2.9 192,964 1

Hash (cost=141,970.09..141,970.09 rows=67,231 width=4) (actual time=305.185..305.185 rows=192,964 loops=1)

  • Buckets: 262144 (originally 131072) Batches: 1 (originally 1) Memory Usage: 8832kB
31. 223.846 263.943 ↓ 2.9 192,964 1

Bitmap Heap Scan on orders o_1 (cost=1,097.38..141,970.09 rows=67,231 width=4) (actual time=69.675..263.943 rows=192,964 loops=1)

  • Recheck Cond: (isinwork AND ((supplierid)::integer = 6))
  • Heap Blocks: exact=117305
32. 40.097 40.097 ↓ 2.9 192,966 1

Bitmap Index Scan on i_orders_samples_isinwork_date (cost=0.00..1,080.58 rows=67,231 width=0) (actual time=40.097..40.097 rows=192,966 loops=1)

33. 2.463 2.463 ↑ 1.0 1 821

Index Scan using i_orderitems_orderitemidobjectstatusid on orderitems oi (cost=0.56..7.35 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=821)

  • Index Cond: ((orderitemid)::integer = (oir.orderitemid)::integer)
  • Filter: (COALESCE(amountgiven, 0) = 0)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using customers_pkey on customers ccu (cost=0.29..8.31 rows=1 width=16) (never executed)

  • Index Cond: ((customerid)::integer = (o.customerid)::integer)
35. 0.000 0.000 ↓ 0.0 0

Index Scan using i_suborder_order on suborders so (cost=0.43..8.45 rows=1 width=8) (never executed)

  • Index Cond: ((orderid)::integer = 2892634)
  • Filter: ((objectstatusid <= 1) AND ((pickupstoreid)::integer = 62))
36. 0.000 0.000 ↓ 0.0 0

Index Scan using contracts_pkey on contracts cso (cost=0.42..8.44 rows=1 width=8) (never executed)

  • Index Cond: ((contractid)::integer = (so.contractid)::integer)
37. 0.000 0.000 ↓ 0.0 0

Index Scan using contracttypes_pkey on contracttypes csot (cost=0.14..0.16 rows=1 width=150) (never executed)

  • Index Cond: ((contracttypeid)::integer = (cso.contracttypeid)::integer)
38. 0.000 0.000 ↓ 0.0 0

Index Scan using contracts_pkey on contracts co (cost=0.42..8.44 rows=1 width=26) (never executed)

  • Index Cond: ((contractid)::integer = (o.contractid)::integer)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using contracttypes_pkey on contracttypes ct (cost=0.14..0.16 rows=1 width=150) (never executed)

  • Index Cond: ((contracttypeid)::integer = (co.contracttypeid)::integer)
40. 0.000 0.000 ↓ 0.0 0

Index Scan using contractpaymenttypes_pkey on contractpaymenttypes cpt (cost=0.13..0.15 rows=1 width=150) (never executed)

  • Index Cond: ((contractpaymenttypeid)::integer = (co.contractpaymenttypeid)::integer)
41. 0.000 0.000 ↓ 0.0 0

Index Scan using companies_pkey on companies cc (cost=0.29..0.71 rows=1 width=39) (never executed)

  • Index Cond: ((companyid)::integer = (ccu.customerid)::integer)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using persons_pkey on persons jpcc (cost=0.42..8.44 rows=1 width=35) (never executed)

  • Index Cond: ((personid)::integer = (o.customerjpid)::integer)
43. 0.000 0.000 ↓ 0.0 0

Index Scan using companies_pkey on companies sc (cost=0.29..8.31 rows=1 width=33) (never executed)

  • Index Cond: ((companyid)::integer = (o.supplierid)::integer)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using persons_pkey on persons jpsc (cost=0.42..8.44 rows=1 width=35) (never executed)

  • Index Cond: ((personid)::integer = (o.supplierjpid)::integer)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using i_persons_role_10 on persons frc (cost=0.14..8.16 rows=1 width=35) (never executed)

  • Index Cond: ((personid)::integer = (o.frcid)::integer)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using persons_pkey on persons sm (cost=0.42..0.85 rows=1 width=35) (never executed)

  • Index Cond: ((personid)::integer = ccu.salesid)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using persons_pkey on persons sp (cost=0.42..8.44 rows=1 width=35) (never executed)

  • Index Cond: ((personid)::integer = (o.ownpersonid)::integer)
48. 0.000 0.000 ↓ 0.0 0

Hash Right Join (cost=1.53..3.87 rows=2 width=36) (never executed)

  • Hash Cond: ((srp_1.salerankid)::integer = (sr.salerankid)::integer)
49. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1.36..3.56 rows=32 width=15) (never executed)

  • Hash Cond: ((srp_1.contractcompanyid)::integer = (cc_1.contractcompanyid)::integer)
50. 0.000 0.000 ↓ 0.0 0

Seq Scan on salerankparams srp_1 (cost=0.00..1.64 rows=64 width=19) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.22..1.22 rows=11 width=4) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Seq Scan on contractcompanies cc_1 (cost=0.00..1.22 rows=11 width=4) (never executed)

  • Filter: isdefault
53. 0.000 0.000 ↓ 0.0 0

Hash (cost=0.16..0.16 rows=1 width=150) (never executed)

54. 0.000 0.000 ↓ 0.0 0

Index Scan using saleranks_pkey on saleranks sr (cost=0.14..0.16 rows=1 width=150) (never executed)

  • Index Cond: ((salerankid)::integer = (ccu.salerankid)::integer)
Planning time : 17.871 ms
Execution time : 313.515 ms