explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NFQR

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 133.796 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,393.34..127,440.28 rows=2 width=1,216) (actual time=133.796..133.796 rows=0 loops=1)

2. 0.001 133.795 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,391.81..127,436.37 rows=1 width=1,121) (actual time=133.795..133.795 rows=0 loops=1)

3. 0.001 133.794 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,391.39..127,427.92 rows=1 width=1,094) (actual time=133.794..133.794 rows=0 loops=1)

4. 0.000 133.793 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,390.97..127,427.06 rows=1 width=1,063) (actual time=133.793..133.793 rows=0 loops=1)

5. 0.000 133.793 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,390.83..127,418.90 rows=1 width=1,032) (actual time=133.793..133.793 rows=0 loops=1)

6. 0.001 133.793 ↓ 0.0 0 1

Nested Loop (cost=127,390.41..127,410.45 rows=1 width=1,001) (actual time=133.793..133.793 rows=0 loops=1)

7. 0.000 133.792 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,390.12..127,402.13 rows=1 width=972) (actual time=133.792..133.792 rows=0 loops=1)

8. 0.000 133.792 ↓ 0.0 0 1

Nested Loop (cost=127,389.70..127,393.68 rows=1 width=941) (actual time=133.792..133.792 rows=0 loops=1)

9. 0.001 133.792 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,389.41..127,392.96 rows=1 width=910) (actual time=133.792..133.792 rows=0 loops=1)

10. 0.013 133.791 ↓ 0.0 0 1

Hash Right Join (cost=127,389.28..127,392.80 rows=1 width=764) (actual time=133.791..133.791 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 133.778 ↓ 0.0 0 1

Hash (cost=127,389.26..127,389.26 rows=1 width=700) (actual time=133.778..133.778 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
13. 0.015 133.778 ↓ 0.0 0 1

Hash Join (cost=127,388.21..127,389.26 rows=1 width=700) (actual time=133.778..133.778 rows=0 loops=1)

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

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

15. 0.000 133.752 ↓ 0.0 0 1

Hash (cost=127,388.20..127,388.20 rows=1 width=504) (actual time=133.752..133.752 rows=0 loops=1)

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

Nested Loop Left Join (cost=127,352.74..127,388.20 rows=1 width=504) (actual time=133.752..133.752 rows=0 loops=1)

17. 0.000 133.752 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,352.60..127,388.04 rows=1 width=358) (actual time=133.752..133.752 rows=0 loops=1)

18. 0.001 133.752 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,352.18..127,379.59 rows=1 width=336) (actual time=133.752..133.752 rows=0 loops=1)

19. 0.000 133.751 ↓ 0.0 0 1

Nested Loop Left Join (cost=127,352.05..127,379.42 rows=1 width=190) (actual time=133.751..133.751 rows=0 loops=1)

20. 0.001 133.751 ↓ 0.0 0 1

Nested Loop (cost=127,351.63..127,370.98 rows=1 width=190) (actual time=133.751..133.751 rows=0 loops=1)

21. 0.000 133.750 ↓ 0.0 0 1

Nested Loop (cost=127,351.20..127,362.51 rows=1 width=186) (actual time=133.750..133.750 rows=0 loops=1)

22. 0.011 133.750 ↓ 0.0 0 1

Hash Join (cost=127,350.91..127,354.20 rows=1 width=170) (actual time=133.750..133.750 rows=0 loops=1)

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

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

24. 0.000 133.731 ↓ 0.0 0 1

Hash (cost=127,350.89..127,350.89 rows=1 width=147) (actual time=133.731..133.731 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
25. 0.297 133.731 ↓ 0.0 0 1

Index Scan using i_orders_orderidobjectstatusid on orders o (cost=127,342.87..127,350.89 rows=1 width=147) (actual time=133.731..133.731 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.000 133.434 ↓ 59.3 830 1

Nested Loop (cost=21,766.87..127,342.41 rows=14 width=4) (actual time=126.722..133.434 rows=830 loops=1)

28. 1.133 130.272 ↑ 4.7 830 1

Hash Join (cost=21,766.31..98,424.64 rows=3,931 width=8) (actual time=126.693..130.272 rows=830 loops=1)

  • Hash Cond: ((oir.orderid)::integer = (o_1.orderid)::integer)
29. 3.254 3.254 ↑ 178.6 945 1

Index Scan using i_orderitemreserves_4_samples on orderitemreserves oir (cost=0.28..75,986.27 rows=168,808 width=8) (actual time=0.010..3.254 rows=945 loops=1)

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

Hash (cost=20,925.72..20,925.72 rows=67,225 width=4) (actual time=125.885..125.885 rows=192,964 loops=1)

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

Index Only Scan using i_orders_samples_isinwork on orders o_1 (cost=0.42..20,925.72 rows=67,225 width=4) (actual time=0.035..76.864 rows=192,964 loops=1)

  • Heap Fetches: 34190
32. 3.320 3.320 ↑ 1.0 1 830

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

  • Index Cond: ((orderitemid)::integer = (oir.orderitemid)::integer)
  • Filter: (COALESCE(amountgiven, 0) = 0)
33. 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)
34. 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))
35. 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)
36. 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)
37. 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)
38. 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)
39. 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)
40. 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)
41. 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)
42. 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)
43. 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)
44. 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)
45. 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)
46. 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)
47. 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)
48. 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)
49. 0.000 0.000 ↓ 0.0 0

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

50. 0.000 0.000 ↓ 0.0 0

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

51. 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
52. 0.000 0.000 ↓ 0.0 0

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

53. 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 : 22.855 ms
Execution time : 135.123 ms