explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4FME

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

Nested Loop Left Join (cost=607.73..3,323.97 rows=3 width=726) (actual rows= loops=)

2.          

Initplan (for Nested Loop Left Join)

3. 0.000 0.000 ↓ 0.0

Index Scan using good_pkey on good __t34 (cost=0.43..3.46 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = '7fbd6891-ff72-11e7-6b01-4b1d0018d1d2'::uuid)
  • Filter: (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid)
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=603.99..3,319.43 rows=3 width=322) (actual rows= loops=)

  • Join Filter: (__t2.id = __t6.id)
5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=542.64..3,257.97 rows=3 width=290) (actual rows= loops=)

  • Join Filter: (__t2.id = __t5.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=408.05..3,123.26 rows=3 width=258) (actual rows= loops=)

  • Join Filter: (((__t0.dtype)::text = 'Kit'::text) AND (__t4.good_id = __t0.id))
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=290.84..3,005.92 rows=3 width=231) (actual rows= loops=)

  • Join Filter: (((__t0.dtype)::text = 'Good'::text) AND (__t2.id = __t3.id))
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.65..2,724.61 rows=3 width=199) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on feature __t2 (cost=9.22..826.23 rows=553 width=62) (actual rows= loops=)

  • Recheck Cond: (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid)
  • Filter: (NOT archived)
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on i__feature__account_id (cost=0.00..9.09 rows=554 width=0) (actual rows= loops=)

  • Index Cond: (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid)
11. 0.000 0.000 ↓ 0.0

Index Scan using good_pkey on good __t0 (cost=0.43..3.43 rows=1 width=153) (actual rows= loops=)

  • Index Cond: (id = __t2.parent_id)
  • Filter: ((NOT archived) AND ((dtype)::text = ANY ('{Good,Kit}'::text[])) AND (((path)::text || (id)::text) ~~ $0))
12. 0.000 0.000 ↓ 0.0

Materialize (cost=281.18..281.26 rows=1 width=48) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Subquery Scan on __t3 (cost=281.18..281.26 rows=1 width=48) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=281.18..281.25 rows=1 width=48) (actual rows= loops=)

  • Group Key: __t8.id
15. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=281.18..281.22 rows=1 width=64) (actual rows= loops=)

  • Group Key: __t8.id, (CASE WHEN (((__t10.path)::text || (__t10.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
16. 0.000 0.000 ↓ 0.0

Sort (cost=281.18..281.19 rows=1 width=37) (actual rows= loops=)

  • Sort Key: __t8.id, (CASE WHEN (((__t10.path)::text || (__t10.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.13..281.17 rows=1 width=37) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.70..280.62 rows=1 width=60) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.27..280.11 rows=1 width=44) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..276.66 rows=1 width=44) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using i__cost_momentto on cost __t9 (cost=0.56..107.48 rows=56 width=37) (actual rows= loops=)

  • Index Cond: ((account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid) AND (momentto > '2020-02-06 13:43:00'::timestamp without time zone))
  • Filter: ((initialcost_id IS NULL) AND (motion_id IS NOT NULL) AND isvalid AND (momentfrom <= '2020-02-06 13:43:00'::timestamp without time zone) AND (stock <> '0'::numeric))
22. 0.000 0.000 ↓ 0.0

Index Scan using place_pkey on place __t10 (cost=0.29..3.02 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (id = __t9.store_id)
  • Filter: (((path)::text || (id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text)
23. 0.000 0.000 ↓ 0.0

Index Scan using consignment_pkey on consignment __t11 (cost=0.43..3.45 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = __t9.consignment_id)
24. 0.000 0.000 ↓ 0.0

Index Scan using pk__feature on feature __t8 (cost=0.43..0.51 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = __t11.feature_id)
25. 0.000 0.000 ↓ 0.0

Index Scan using good_pkey on good __t12 (cost=0.43..0.55 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = __t8.parent_id)
  • Filter: (NOT archived)
26. 0.000 0.000 ↓ 0.0

Materialize (cost=117.21..117.29 rows=1 width=48) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Subquery Scan on __t4 (cost=117.21..117.28 rows=1 width=48) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=117.21..117.27 rows=1 width=48) (actual rows= loops=)

  • Group Key: __t14.kit_id
29. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=117.21..117.25 rows=1 width=64) (actual rows= loops=)

  • Group Key: __t14.kit_id, __t14.root_store_id
30. 0.000 0.000 ↓ 0.0

Sort (cost=117.21..117.22 rows=1 width=69) (actual rows= loops=)

  • Sort Key: __t14.kit_id, __t14.root_store_id
31. 0.000 0.000 ↓ 0.0

Subquery Scan on __t14 (cost=117.14..117.20 rows=1 width=69) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=117.14..117.19 rows=1 width=85) (actual rows= loops=)

  • Group Key: __t15.id, (CASE WHEN (((__t19.path)::text || (__t19.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
33. 0.000 0.000 ↓ 0.0

Sort (cost=117.14..117.15 rows=1 width=64) (actual rows= loops=)

  • Sort Key: __t15.id, (CASE WHEN (((__t19.path)::text || (__t19.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
34. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4.76..117.13 rows=1 width=64) (actual rows= loops=)

  • Join Filter: (__t19.id = __t18.store_id)
35. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=4.21..113.54 rows=1 width=100) (actual rows= loops=)

  • Join Filter: (__t19.id = __t17.store_id)
36. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.65..109.97 rows=1 width=97) (actual rows= loops=)

  • Join Filter: (__t19.id = __t16.store_id)
37. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.09..106.37 rows=1 width=92) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.81..103.05 rows=1 width=69) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.38..99.61 rows=1 width=85) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on kitelement __t15 (cost=1.94..30.41 rows=20 width=69) (actual rows= loops=)

  • Recheck Cond: (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid)
41. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_kitelement_account_id (cost=0.00..1.94 rows=20 width=0) (actual rows= loops=)

  • Index Cond: (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid)
42. 0.000 0.000 ↓ 0.0

Index Scan using i_consignment_feature_id on consignment __t20 (cost=0.43..3.45 rows=1 width=64) (actual rows= loops=)

  • Index Cond: (feature_id = __t15.element_id)
  • Filter: (isdefault AND (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid))
43. 0.000 0.000 ↓ 0.0

Index Scan using good_pkey on good __t21 (cost=0.43..3.43 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = __t20.good_id)
  • Filter: (((dtype)::text <> 'Service'::text) AND (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid))
44. 0.000 0.000 ↓ 0.0

Index Scan using i__account_place__evotor_id_new on place __t19 (cost=0.29..3.32 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid)
  • Filter: (((path)::text || (id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text)
45. 0.000 0.000 ↓ 0.0

Index Scan using cost_cons_moment on cost __t16 (cost=0.56..3.58 rows=1 width=53) (actual rows= loops=)

  • Index Cond: ((__t20.account_id = account_id) AND (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid) AND (__t20.id = consignment_id))
  • Filter: ((initialcost_id IS NULL) AND (motion_id IS NOT NULL) AND isvalid AND (momentfrom <= '2020-02-06 13:43:00'::timestamp without time zone) AND (momentto > '2020-02-06 13:43:00'::timestamp without time zone))
46. 0.000 0.000 ↓ 0.0

Index Scan using i__reserve_momentto on reserve __t17 (cost=0.56..3.57 rows=1 width=51) (actual rows= loops=)

  • Index Cond: ((account_id = __t20.account_id) AND (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid) AND (__t20.id = consignment_id) AND (momentto > '2020-02-06 13:43:00'::timestamp without time zone))
  • Filter: ((motion_id IS NOT NULL) AND isvalid AND (momentfrom <= '2020-02-06 13:43:00'::timestamp without time zone) AND (reservetype = 1))
47. 0.000 0.000 ↓ 0.0

Index Scan using i__reserve_momentto on reserve __t18 (cost=0.56..3.57 rows=1 width=51) (actual rows= loops=)

  • Index Cond: ((account_id = __t20.account_id) AND (account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid) AND (__t20.id = consignment_id) AND (momentto > '2020-02-06 13:43:00'::timestamp without time zone))
  • Filter: ((motion_id IS NOT NULL) AND isvalid AND (momentfrom <= '2020-02-06 13:43:00'::timestamp without time zone) AND (reservetype = 0))
48. 0.000 0.000 ↓ 0.0

Materialize (cost=134.59..134.67 rows=1 width=48) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Subquery Scan on __t5 (cost=134.59..134.66 rows=1 width=48) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=134.59..134.65 rows=1 width=48) (actual rows= loops=)

  • Group Key: __t23.id
51. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=134.59..134.62 rows=1 width=64) (actual rows= loops=)

  • Group Key: __t23.id, (CASE WHEN (((__t25.path)::text || (__t25.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
52. 0.000 0.000 ↓ 0.0

Sort (cost=134.59..134.59 rows=1 width=35) (actual rows= loops=)

  • Sort Key: __t23.id, (CASE WHEN (((__t25.path)::text || (__t25.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
53. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.13..134.58 rows=1 width=35) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.70..134.02 rows=1 width=58) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.27..133.51 rows=1 width=42) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..130.06 rows=1 width=42) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Index Scan using i__reserve_momentto on reserve __t24 (cost=0.56..50.15 rows=25 width=35) (actual rows= loops=)

  • Index Cond: ((account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid) AND (momentto > '2020-02-06 13:43:00'::timestamp without time zone))
  • Filter: (isvalid AND (momentfrom <= '2020-02-06 13:43:00'::timestamp without time zone) AND (reservetype = 1))
58. 0.000 0.000 ↓ 0.0

Index Scan using place_pkey on place __t25 (cost=0.29..3.20 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (id = __t24.store_id)
  • Filter: (((path)::text || (id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text)
59. 0.000 0.000 ↓ 0.0

Index Scan using consignment_pkey on consignment __t26 (cost=0.43..3.45 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = __t24.consignment_id)
60. 0.000 0.000 ↓ 0.0

Index Scan using pk__feature on feature __t23 (cost=0.43..0.51 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = __t26.feature_id)
61. 0.000 0.000 ↓ 0.0

Index Scan using good_pkey on good __t27 (cost=0.43..0.55 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = __t23.parent_id)
  • Filter: (NOT archived)
62. 0.000 0.000 ↓ 0.0

Materialize (cost=61.35..61.42 rows=1 width=48) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Subquery Scan on __t6 (cost=61.35..61.42 rows=1 width=48) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=61.35..61.41 rows=1 width=48) (actual rows= loops=)

  • Group Key: __t29.id
65. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=61.35..61.38 rows=1 width=64) (actual rows= loops=)

  • Group Key: __t29.id, (CASE WHEN (((__t31.path)::text || (__t31.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
66. 0.000 0.000 ↓ 0.0

Sort (cost=61.35..61.35 rows=1 width=35) (actual rows= loops=)

  • Sort Key: __t29.id, (CASE WHEN (((__t31.path)::text || (__t31.id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text) THEN '7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db'::uuid ELSE NULL::uuid END)
67. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.13..61.34 rows=1 width=35) (actual rows= loops=)

68. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.70..60.78 rows=1 width=58) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.27..60.27 rows=1 width=42) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..56.82 rows=1 width=42) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Index Scan using i__reserve_momentto on reserve __t30 (cost=0.56..50.15 rows=2 width=35) (actual rows= loops=)

  • Index Cond: ((account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid) AND (momentto > '2020-02-06 13:43:00'::timestamp without time zone))
  • Filter: (isvalid AND (momentfrom <= '2020-02-06 13:43:00'::timestamp without time zone) AND (reservetype = 0))
72. 0.000 0.000 ↓ 0.0

Index Scan using place_pkey on place __t31 (cost=0.29..3.32 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (id = __t30.store_id)
  • Filter: (((path)::text || (id)::text) ~~ '/7bc6d4c8-ff62-11e7-6b01-4b1d0015f3db%'::text)
73. 0.000 0.000 ↓ 0.0

Index Scan using consignment_pkey on consignment __t32 (cost=0.43..3.45 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = __t30.consignment_id)
74. 0.000 0.000 ↓ 0.0

Index Scan using pk__feature on feature __t29 (cost=0.43..0.51 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = __t32.feature_id)
75. 0.000 0.000 ↓ 0.0

Index Scan using good_pkey on good __t33 (cost=0.43..0.55 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = __t29.parent_id)
  • Filter: (NOT archived)
76. 0.000 0.000 ↓ 0.0

Index Scan using uom_pkey on uom __t1 (cost=0.28..0.31 rows=1 width=31) (actual rows= loops=)

  • Index Cond: (id = __t0.uom_id)
  • Filter: ((account_id = '7ba9c902-ff62-11e7-7a69-971100005844'::uuid) OR (account_id IS NULL))