explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ka5l

Settings
# exclusive inclusive rows x rows loops node
1. 23.215 178,852.085 ↓ 4,104.0 4,104 1

Sort (cost=1,121.45..1,121.46 rows=1 width=1,444) (actual time=178,851.655..178,852.085 rows=4,104 loops=1)

  • Output: c.id, ((((g.name)::text || ' '::text) || (f.name)::text)), f.code, f.isdefault, (array_agg(favm.name ORDER BY (array_position(g.featureattributeorder, favm.id)))), (array_agg(fav.valuestring ORDER BY (array_position(g.featureattributeorder, favm. (...)
  • Sort Key: c.id
  • Sort Method: quicksort Memory: 4361kB
  • Buffers: shared hit=19841019
2. 25.249 178,828.870 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,113.08..1,121.44 rows=1 width=1,444) (actual time=203.202..178,828.870 rows=4,104 loops=1)

  • Output: c.id, (((g.name)::text || ' '::text) || (f.name)::text), f.code, f.isdefault, (array_agg(favm.name ORDER BY (array_position(g.featureattributeorder, favm.id)))), (array_agg(fav.valuestring ORDER BY (array_position(g.featureattributeorder, f (...)
  • Buffers: shared hit=19841019
3. 8.833 706.437 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,106.78..1,112.45 rows=1 width=1,438) (actual time=157.717..706.437 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.egaishasexcisemark, g.egaisproductcode, g.egaisvolume, g.egaisalcoh (...)
  • Buffers: shared hit=355138
4. 9.773 599.108 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,098.24..1,103.88 rows=1 width=1,358) (actual time=157.661..599.108 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.egaishasexcisemark, g.egaisproductcode (...)
  • Buffers: shared hit=322256
5. 10.320 540.087 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,089.71..1,095.31 rows=1 width=1,262) (actual time=157.633..540.087 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.egaishasexcisemark, g.egaisprodu (...)
  • Buffers: shared hit=306788
6. 7.952 431.271 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,084.30..1,089.87 rows=1 width=1,215) (actual time=157.583..431.271 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.egaishasexcisemark, g.egai (...)
  • Inner Unique: true
  • Buffers: shared hit=275326
7. 6.961 419.215 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,084.03..1,089.56 rows=1 width=1,127) (actual time=157.578..419.215 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.egaishasexcisemark, (...)
  • Inner Unique: true
  • Buffers: shared hit=267102
8. 8.008 399.942 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,083.76..1,089.24 rows=1 width=1,039) (actual time=157.573..399.942 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.egaishasexcise (...)
  • Inner Unique: true
  • Buffers: shared hit=258873
9. 5.195 375.518 ↓ 4,104.0 4,104 1

Nested Loop (cost=1,083.48..1,088.93 rows=1 width=1,048) (actual time=157.566..375.518 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.egaishas (...)
  • Buffers: shared hit=246567
10. 6.129 349.803 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,083.06..1,087.50 rows=1 width=1,032) (actual time=157.562..349.803 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic, g.eg (...)
  • Inner Unique: true
  • Buffers: shared hit=230102
11. 8.707 323.154 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,082.64..1,085.19 rows=1 width=974) (actual time=157.555..323.154 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalcoholic (...)
  • Inner Unique: true
  • Buffers: shared hit=213686
12. 8.574 314.447 ↓ 4,104.0 4,104 1

Nested Loop (cost=1,082.51..1,085.03 rows=1 width=458) (actual time=157.553..314.447 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, (sum(r.reservestock)), g.name, g.code, g.productcode, g.vat, g.dtype, g.egaisisalc (...)
  • Inner Unique: true
  • Buffers: shared hit=213686
13. 8.208 281.249 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,082.08..1,084.52 rows=1 width=184) (actual time=157.543..281.249 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, f.parent_id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, deffeature.parent_id, (sum(r.reservestock))
  • Inner Unique: true
  • Join Filter: (f.id = f_2.id)
  • Buffers: shared hit=197259
14. 8.288 273.041 ↓ 4,104.0 4,104 1

Nested Loop (cost=1,014.84..1,017.23 rows=1 width=152) (actual time=157.527..273.041 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, f.parent_id, (sum(cost.stock)), c.id, deffeature.id, deffeature.account_id, deffeature.parent_id
  • Inner Unique: true
  • Buffers: shared hit=197255
15. 4.656 244.233 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1,014.42..1,016.74 rows=1 width=104) (actual time=157.521..244.233 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, f.parent_id, (sum(cost.stock)), c.id
  • Buffers: shared hit=180837
16. 7.764 210.849 ↓ 4,104.0 4,104 1

Nested Loop (cost=1,013.99..1,016.25 rows=1 width=88) (actual time=157.515..210.849 rows=4,104 loops=1)

  • Output: f.name, f.code, f.isdefault, f.id, f.parent_id, (sum(cost.stock))
  • Inner Unique: true
  • Buffers: shared hit=164401
17. 2.150 178.461 ↓ 4,104.0 4,104 1

Limit (cost=1,013.57..1,013.60 rows=1 width=101) (actual time=157.507..178.461 rows=4,104 loops=1)

  • Output: f_1.id, g_1.dtype, c_1.id, (sum(cost.stock)), NULL::numeric
  • Buffers: shared hit=147966
18.          

Initplan (for Limit)

19. 0.005 0.024 ↑ 1.0 1 1

Nested Loop (cost=0.42..5.27 rows=1 width=32) (actual time=0.021..0.024 rows=1 loops=1)

  • Output: (((p_5.path)::text || (p_5.id)::text) || '%'::text)
  • Inner Unique: true
  • Buffers: shared hit=6
20. 0.013 0.013 ↑ 1.0 1 1

Index Scan using i__retailstore__account_id on ms.retailstore r_2 (cost=0.14..2.37 rows=1 width=16) (actual time=0.011..0.013 rows=1 loops=1)

  • Output: r_2.id, r_2.version, r_2.updated, r_2.updatedby, r_2.deleted, r_2.name, r_2.description, r_2.code, r_2.externalcode, r_2.address, r_2.wa (...)
  • Index Cond: (r_2.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Filter: (r_2.id = 'ca3e93a6-dec1-11e8-9ff4-34e8000ae1e1'::uuid)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=3
21. 0.006 0.006 ↑ 1.0 1 1

Index Scan using place_pkey on ms.place p_5 (cost=0.28..2.50 rows=1 width=69) (actual time=0.006..0.006 rows=1 loops=1)

  • Output: p_5.dtype, p_5.id, p_5.version, p_5.deleted, p_5.updated, p_5.description, p_5.name, p_5.path, p_5.address, p_5.email, p_5.faxes, p_5.mo (...)
  • Index Cond: (p_5.id = r_2.warehouse_id)
  • Filter: (p_5.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=3
22. 16.792 176.287 ↓ 4,104.0 4,104 1

GroupAggregate (cost=1,008.30..1,008.33 rows=1 width=101) (actual time=157.506..176.287 rows=4,104 loops=1)

  • Output: f_1.id, g_1.dtype, c_1.id, sum(cost.stock), NULL::numeric
  • Group Key: c_1.id, f_1.id, g_1.dtype
  • Buffers: shared hit=147966
23. 5.204 159.495 ↓ 4,104.0 4,104 1

Sort (cost=1,008.30..1,008.30 rows=1 width=41) (actual time=157.496..159.495 rows=4,104 loops=1)

  • Output: f_1.id, g_1.dtype, c_1.id, cost.stock
  • Sort Key: c_1.id, f_1.id, g_1.dtype
  • Sort Method: quicksort Memory: 513kB
  • Buffers: shared hit=147966
24. 23.833 154.291 ↓ 4,104.0 4,104 1

Nested Loop Left Join (cost=1.97..1,008.29 rows=1 width=41) (actual time=0.115..154.291 rows=4,104 loops=1)

  • Output: f_1.id, g_1.dtype, c_1.id, cost.stock
  • Inner Unique: true
  • Filter: (((cost.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid) AND (cost.momentto = 'infinity'::timestamp without time zone) AND (...)
  • Rows Removed by Filter: 11878
  • Buffers: shared hit=147966
25. 59.811 114.476 ↓ 15,982.0 15,982 1

Nested Loop Left Join (cost=1.70..1,007.96 rows=1 width=130) (actual time=0.074..114.476 rows=15,982 loops=1)

  • Output: f_1.id, c_1.id, cost.stock, cost.consignment_id, cost.store_id, cost.account_id, cost.momentto, cost.initialcost_id, cost.moti (...)
  • Filter: (((COALESCE(cost.stock, '0'::numeric) > '0'::numeric) AND ((g_1.dtype)::text = 'Good'::text)) OR ((g_1.dtype)::text <> 'Good': (...)
  • Rows Removed by Filter: 6903
  • Buffers: shared hit=100014
  • -> Index Scan using i__cost__consignment_id on ms.cost (cost=0.43..15.12 rows=41 width=93) (actual time=0.003..0.004 rows=2 loops=10 (...)
26. 36.248 54.665 ↓ 10,224.0 10,224 1

Nested Loop (cost=1.27..992.13 rows=1 width=37) (actual time=0.054..54.665 rows=10,224 loops=1)

  • Output: f_1.id, c_1.id, g_1.dtype
  • Buffers: shared hit=50065
  • -> Index Scan using i_consignment_feature_id on ms.consignment c_1 (cost=0.42..1.34 rows=1 width=32) (actual time=0.003..0.003 (...)
  • Output: cost.id, cost.moment, cost.store_id, cost.slot_id, cost.consignment_id, cost.operation_id, cost."position", cost.motion_ (...)
  • Index Cond: (c_1.id = cost.consignment_id)
  • Buffers: shared hit=49949
27. 18.417 18.417 ↓ 10,224.0 10,224 1

Nested Loop (cost=0.84..990.78 rows=1 width=21) (actual time=0.043..18.417 rows=10,224 loops=1)

  • Output: f_1.id, g_1.dtype
  • Buffers: shared hit=9093
  • -> Index Scan using i__good__account_id on ms.good g_1 (cost=0.42..960.61 rows=8 width=21) (actual time=0.029..2.690 row (...)
  • Output: g_1.dtype, g_1.id, g_1.version, g_1.deleted, g_1.updated, g_1.description, g_1.name, g_1.path, g_1.code, g_1 (...)
  • Index Cond: (g_1.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Filter: ((NOT g_1.archived) AND (((g_1.path)::text ~~ '/d1806e1f-0f29-11e8-9ff4-34e800011aa2%'::text) OR ((g_1.path) (...)
  • Rows Removed by Filter: 143
  • Buffers: shared hit=976
  • -> Index Scan using i__feature__parent_id on ms.feature f_1 (cost=0.42..3.76 rows=1 width=32) (actual time=0.004..0.008 (...)
  • Output: f_1.id, f_1.version, f_1.updated, f_1.updatedby, f_1.deleted, f_1.md, f_1.parent_id, f_1.externalcode, f_1.a (...)
  • Index Cond: (f_1.parent_id = g_1.id)
  • Filter: ((NOT f_1.archived) AND (f_1.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid))
  • Buffers: shared hit=8117
  • Output: c_1.id, c_1.version, c_1.deleted, c_1.updated, c_1.description, c_1.name, c_1.isdefault, c_1.good_id, c_1.updatedb (...)
  • Index Cond: (c_1.feature_id = f_1.id)
  • Filter: (c_1.isdefault AND (c_1.id > '00000000-0000-0000-0000-000000000000'::uuid) AND (c_1.account_id = '01733d5f-0e6b-11 (...)
  • Buffers: shared hit=40972
28. 15.982 15.982 ↑ 1.0 1 15,982

Index Scan using place_pkey on ms.place p (cost=0.28..0.29 rows=1 width=69) (actual time=0.001..0.001 rows=1 loops=15,982)

  • Output: p.dtype, p.id, p.version, p.deleted, p.updated, p.description, p.name, p.path, p.address, p.email, p.faxes, p.mobiles, p.phone (...)
  • Index Cond: (cost.store_id = p.id)
  • Buffers: shared hit=47946
29. 24.624 24.624 ↑ 1.0 1 4,104

Index Scan using pk__feature on ms.feature f (cost=0.42..2.64 rows=1 width=56) (actual time=0.006..0.006 rows=1 loops=4,104)

  • Output: f.id, f.version, f.updated, f.updatedby, f.deleted, f.md, f.parent_id, f.externalcode, f.account_id, f.name, f.description, f.code, f.archived, f.attr (...)
  • Index Cond: (f.id = f_1.id)
  • Buffers: shared hit=16435
30. 28.728 28.728 ↑ 1.0 1 4,104

Index Scan using i_consignment_feature_id on ms.consignment c (cost=0.42..0.49 rows=1 width=32) (actual time=0.006..0.007 rows=1 loops=4,104)

  • Output: c.id, c.version, c.deleted, c.updated, c.description, c.name, c.isdefault, c.good_id, c.updatedby, c.code, c.externalcode, c.feature_id, c.consname, c.accou (...)
  • Index Cond: (c.feature_id = f.id)
  • Filter: (c.isdefault AND (c.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid))
  • Buffers: shared hit=16436
31. 20.520 20.520 ↑ 1.0 1 4,104

Index Scan using u__feature__default on ms.feature deffeature (cost=0.42..0.49 rows=1 width=48) (actual time=0.005..0.005 rows=1 loops=4,104)

  • Output: deffeature.id, deffeature.version, deffeature.updated, deffeature.updatedby, deffeature.deleted, deffeature.md, deffeature.parent_id, deffeature.externalcode, def (...)
  • Index Cond: (deffeature.parent_id = f.parent_id)
  • Filter: (deffeature.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=16418
32. 0.000 0.000 ↓ 0.0 0 4,104

GroupAggregate (cost=67.24..67.27 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=4,104)

  • Output: f_2.id, sum(r.reservestock)
  • Group Key: f_2.id
  • Buffers: shared hit=4
33.          

Initplan (for GroupAggregate)

34. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..5.27 rows=1 width=32) (never executed)

  • Output: (((p_4.path)::text || (p_4.id)::text) || '%'::text)
  • Inner Unique: true
35. 0.000 0.000 ↓ 0.0 0

Index Scan using i__retailstore__account_id on ms.retailstore r_1 (cost=0.14..2.37 rows=1 width=16) (never executed)

  • Output: r_1.id, r_1.version, r_1.updated, r_1.updatedby, r_1.deleted, r_1.name, r_1.description, r_1.code, r_1.externalcode, r_1.address, r_1.warehouse_id, r_1.my (...)
  • Index Cond: (r_1.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Filter: (r_1.id = 'ca3e93a6-dec1-11e8-9ff4-34e8000ae1e1'::uuid)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using place_pkey on ms.place p_4 (cost=0.28..2.50 rows=1 width=69) (never executed)

  • Output: p_4.dtype, p_4.id, p_4.version, p_4.deleted, p_4.updated, p_4.description, p_4.name, p_4.path, p_4.address, p_4.email, p_4.faxes, p_4.mobiles, p_4.phones, (...)
  • Index Cond: (p_4.id = r_1.warehouse_id)
  • Filter: (p_4.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
37. 0.000 0.000 ↓ 0.0 0 4,104

Sort (cost=61.97..61.98 rows=1 width=19) (actual time=0.000..0.000 rows=0 loops=4,104)

  • Output: f_2.id, r.reservestock
  • Sort Key: f_2.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=4
38. 0.001 0.007 ↓ 0.0 0 1

Nested Loop (cost=2.09..61.96 rows=1 width=19) (actual time=0.007..0.007 rows=0 loops=1)

  • Output: f_2.id, r.reservestock
  • Inner Unique: true
  • Buffers: shared hit=4
39. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=1.67..60.55 rows=1 width=35) (actual time=0.006..0.006 rows=0 loops=1)

  • Output: r.reservestock, f_2.id, f_2.parent_id
  • Inner Unique: true
  • Buffers: shared hit=4
40. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=1.25..60.06 rows=1 width=19) (actual time=0.006..0.006 rows=0 loops=1)

  • Output: r.reservestock, c_2.feature_id
  • Inner Unique: true
  • Buffers: shared hit=4
41. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=0.83..57.42 rows=1 width=19) (actual time=0.006..0.006 rows=0 loops=1)

  • Output: r.reservestock, r.consignment_id
  • Inner Unique: true
  • Buffers: shared hit=4
42. 0.006 0.006 ↓ 0.0 0 1

Index Scan using i__reserve_momentto on ms.reserve r (cost=0.55..25.00 rows=22 width=35) (actual time=0.006..0.006 rows=0 loops=1)

  • Output: r.id, r.account_id, r.motion_id, r.operation_id, r.consignment_id, r.store_id, r.moment, r."position", r.quantity, r.shipped, r.rese (...)
  • Index Cond: ((r.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid) AND (r.momentto = 'infinity'::timestamp without time zone))
  • Filter: (r.isvalid AND (r.reservetype = 1))
  • Buffers: shared hit=4
43. 0.000 0.000 ↓ 0.0 0

Index Scan using place_pkey on ms.place p_1 (cost=0.28..1.45 rows=1 width=16) (never executed)

  • Output: p_1.dtype, p_1.id, p_1.version, p_1.deleted, p_1.updated, p_1.description, p_1.name, p_1.path, p_1.address, p_1.email, p_1.faxes, p_ (...)
  • Index Cond: (p_1.id = r.store_id)
  • Filter: (((p_1.path)::text || (p_1.id)::text) ~~ $2)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using consignment_pkey on ms.consignment c_2 (cost=0.42..2.64 rows=1 width=32) (never executed)

  • Output: c_2.id, c_2.version, c_2.deleted, c_2.updated, c_2.description, c_2.name, c_2.isdefault, c_2.good_id, c_2.updatedby, c_2.code, c_2.externa (...)
  • Index Cond: (c_2.id = r.consignment_id)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using pk__feature on ms.feature f_2 (cost=0.42..0.49 rows=1 width=32) (never executed)

  • Output: f_2.id, f_2.version, f_2.updated, f_2.updatedby, f_2.deleted, f_2.md, f_2.parent_id, f_2.externalcode, f_2.account_id, f_2.name, f_2.description (...)
  • Index Cond: (f_2.id = c_2.feature_id)
  • Filter: ((NOT f_2.archived) AND (f_2.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid))
46. 0.000 0.000 ↓ 0.0 0

Index Scan using good_pkey on ms.good g_2 (cost=0.42..1.40 rows=1 width=16) (never executed)

  • Output: g_2.dtype, g_2.id, g_2.version, g_2.deleted, g_2.updated, g_2.description, g_2.name, g_2.path, g_2.code, g_2.parent_id, g_2.uom_id, g_2.updatedby, g_2 (...)
  • Index Cond: (g_2.id = f_2.parent_id)
  • Filter: ((NOT g_2.archived) AND (g_2.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid) AND ((g_2.dtype)::text = 'Good'::text))
47. 24.624 24.624 ↑ 1.0 1 4,104

Index Scan using good_pkey on ms.good g (cost=0.42..0.50 rows=1 width=306) (actual time=0.006..0.006 rows=1 loops=4,104)

  • Output: g.dtype, g.id, g.version, g.deleted, g.updated, g.description, g.name, g.path, g.code, g.parent_id, g.uom_id, g.updatedby, g.isserialtrackable, g.country_id, g.productcode, g (...)
  • Index Cond: (g.id = f.parent_id)
  • Filter: (g.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=16427
48. 0.000 0.000 ↓ 0.0 0 4,104

Index Scan using taxsystem_pkey on ms.taxsystem ts (cost=0.13..0.15 rows=1 width=532) (actual time=0.000..0.000 rows=0 loops=4,104)

  • Output: ts.id, ts.name, ts.code, ts."position", ts.version, ts.updated, ts.updatedby, ts.deleted, ts.description, ts.externalcode, ts.account_id, ts.owner_id, ts.group_id, ts.shared, ts.pt (...)
  • Index Cond: (ts.id = g.taxsystem_id)
49. 20.520 20.520 ↑ 1.0 1 4,104

Index Scan using good_pkey on ms.good gf (cost=0.42..2.31 rows=1 width=74) (actual time=0.005..0.005 rows=1 loops=4,104)

  • Output: gf.dtype, gf.id, gf.version, gf.deleted, gf.updated, gf.description, gf.name, gf.path, gf.code, gf.parent_id, gf.uom_id, gf.updatedby, gf.isserialtrackable, gf.country_id, gf.productcode (...)
  • Index Cond: (g.parent_id = gf.id)
  • Filter: (gf.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=16416
50. 20.520 20.520 ↑ 1.0 1 4,104

Index Scan using i_consignment_feature_id on ms.consignment defgoodconsignment (cost=0.42..1.42 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=4,104)

  • Output: defgoodconsignment.id, defgoodconsignment.version, defgoodconsignment.deleted, defgoodconsignment.updated, defgoodconsignment.description, defgoodconsignment.name, defgoodconsignment.isdefault (...)
  • Index Cond: (defgoodconsignment.feature_id = deffeature.id)
  • Filter: (defgoodconsignment.isdefault AND (defgoodconsignment.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid))
  • Buffers: shared hit=16465
51. 16.416 16.416 ↑ 1.0 1 4,104

Index Scan using uom_pkey on ms.uom (cost=0.27..0.31 rows=1 width=23) (actual time=0.004..0.004 rows=1 loops=4,104)

  • Output: uom.id, uom.version, uom.deleted, uom.updated, uom.description, uom.name, uom.type, uom.updatedby, uom.code, uom.externalcode, uom.favourite, uom.account_id, uom.owner_id, uom.group_id, uom.shared, (...)
  • Index Cond: (uom.id = g.uom_id)
  • Filter: ((uom.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid) OR (uom.account_id IS NULL))
  • Buffers: shared hit=12306
52. 12.312 12.312 ↓ 0.0 0 4,104

Index Scan using assortmentfavorite_consignment_id_retailstore_id__unique on ms.assortmentfavorite featurefavorite (cost=0.27..0.29 rows=1 width=104) (actual time=0.003..0.003 rows=0 loops=4,104)

  • Output: featurefavorite.*, featurefavorite.consignment_id
  • Index Cond: ((featurefavorite.consignment_id = c.id) AND (featurefavorite.retailstore_id = 'ca3e93a6-dec1-11e8-9ff4-34e8000ae1e1'::uuid))
  • Filter: (featurefavorite.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=8229
53. 4.104 4.104 ↓ 0.0 0 4,104

Index Scan using assortmentfavorite_consignment_id_retailstore_id__unique on ms.assortmentfavorite goodfavorite (cost=0.27..0.29 rows=1 width=104) (actual time=0.001..0.001 rows=0 loops=4,104)

  • Output: goodfavorite.*, goodfavorite.consignment_id
  • Index Cond: ((goodfavorite.consignment_id = defgoodconsignment.id) AND (goodfavorite.retailstore_id = 'ca3e93a6-dec1-11e8-9ff4-34e8000ae1e1'::uuid))
  • Filter: (goodfavorite.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=8224
54. 41.040 98.496 ↑ 1.0 1 4,104

Aggregate (cost=5.41..5.42 rows=1 width=64) (actual time=0.024..0.024 rows=1 loops=4,104)

  • Output: array_agg(fav.valuestring ORDER BY (array_position(g.featureattributeorder, favm.id))), array_agg(favm.name ORDER BY (array_position(g.featureattributeorder, favm.id)))
  • Buffers: shared hit=31462
55. 12.880 57.456 ↑ 1.0 1 4,104

Nested Loop (cost=0.70..5.40 rows=1 width=58) (actual time=0.012..0.014 rows=1 loops=4,104)

  • Output: fav.valuestring, favm.id, favm.name
  • Inner Unique: true
  • Buffers: shared hit=31462
56. 24.624 24.624 ↑ 1.0 1 4,104

Index Scan using u_featureattributevalue_account_feature_metadata on ms.featureattributevalue fav (cost=0.42..2.64 rows=1 width=30) (actual time=0.006..0.006 rows=1 loops=4,104)

  • Output: fav.id, fav.version, fav.updated, fav.updatedby, fav.deleted, fav.valuetext, fav.valuestring, fav.doublevalue, fav.longvalue, fav.booleanvalue, fav.timevalue, fav.agentvalue_id, fav.warehousevalue_id, fav (...)
  • Index Cond: ((fav.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid) AND (f.id = fav.parent_id))
  • Buffers: shared hit=16498
57. 19.952 19.952 ↑ 1.0 1 4,988

Index Scan using attributemetadata_pkey on ms.attributemetadata favm (cost=0.28..2.50 rows=1 width=44) (actual time=0.004..0.004 rows=1 loops=4,988)

  • Output: favm.id, favm.version, favm.updated, favm.updatedby, favm.deleted, favm.name, favm.description, favm.code, favm.attrtype, favm.required, favm.dictionarymetadata_id, favm.entitymetadata_id, favm."position" (...)
  • Index Cond: (favm.id = fav.metadata_id)
  • Filter: (favm.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=14964
58. 20.520 49.248 ↑ 1.0 1 4,104

Aggregate (cost=8.54..8.55 rows=1 width=96) (actual time=0.012..0.012 rows=1 loops=4,104)

  • Output: array_agg(p_2.value ORDER BY pt.index), array_agg(c_3.rate ORDER BY pt.index), array_agg(pt.name ORDER BY pt.index)
  • Buffers: shared hit=15468
59. 0.000 28.728 ↓ 0.0 0 4,104

Nested Loop Left Join (cost=0.71..8.52 rows=1 width=43) (actual time=0.007..0.007 rows=0 loops=4,104)

  • Output: p_2.value, pt.index, c_3.rate, pt.name
  • Inner Unique: true
  • Join Filter: (p_2.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=15468
60. 3.780 28.728 ↓ 0.0 0 4,104

Nested Loop (cost=0.57..6.14 rows=1 width=67) (actual time=0.007..0.007 rows=0 loops=4,104)

  • Output: p_2.value, p_2.currency_id, p_2.account_id, pt.index, pt.name
  • Inner Unique: true
  • Join Filter: (p_2.pricetype_id = pt.id)
  • Buffers: shared hit=15252
61. 24.624 24.624 ↓ 0.0 0 4,104

Index Scan using u__price__parent_id__pricetype_id on ms.price p_2 (cost=0.42..3.77 rows=1 width=56) (actual time=0.006..0.006 rows=0 loops=4,104)

  • Output: p_2.id, p_2.value, p_2.pricetype_id, p_2.currency_id, p_2.parent_id, p_2.account_id, p_2.owner_id, p_2.group_id, p_2.shared, p_2.ptype
  • Index Cond: (p_2.parent_id = f.id)
  • Filter: ((p_2.value <> '0'::double precision) AND (p_2.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=15036
62. 0.324 0.324 ↑ 1.0 1 108

Index Scan using i__pricetype__account_id on ms.pricetype pt (cost=0.14..2.36 rows=1 width=43) (actual time=0.003..0.003 rows=1 loops=108)

  • Output: pt.id, pt.name, pt.index, pt.version, pt.updated, pt.updatedby, pt.deleted, pt.account_id, pt.owner_id, pt.group_id, pt.shared, pt.ptype, pt.externalcode
  • Index Cond: (pt.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=216
63. 0.324 0.324 ↑ 1.0 1 108

Index Scan using currency_pkey on ms.currency c_3 (cost=0.14..2.37 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=108)

  • Output: c_3.id, c_3.version, c_3.deleted, c_3.updated, c_3.description, c_3.name, c_3.updatedby, c_3.code, c_3.rate, c_3.externalcode, c_3.major_s1, c_3.major_s24, c_3.major_s5, c_3.major_sex, c_3.minor_sex, c_3.minor_ (...)
  • Index Cond: (p_2.currency_id = c_3.id)
  • Filter: (c_3.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=216
64. 32.832 98.496 ↑ 1.0 1 4,104

Aggregate (cost=8.53..8.54 rows=1 width=96) (actual time=0.024..0.024 rows=1 loops=4,104)

  • Output: array_agg(p_3.value ORDER BY pt_1.index), array_agg(c_4.rate ORDER BY pt_1.index), array_agg(pt_1.name ORDER BY pt_1.index)
  • Buffers: shared hit=32882
65. 8.208 65.664 ↑ 1.0 1 4,104

Result (cost=0.72..8.52 rows=1 width=43) (actual time=0.015..0.016 rows=1 loops=4,104)

  • Output: p_3.value, pt_1.index, c_4.rate, pt_1.name
  • One-Time Filter: (deffeature.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=32882
66. 8.208 57.456 ↑ 1.0 1 4,104

Nested Loop Left Join (cost=0.72..8.52 rows=1 width=43) (actual time=0.014..0.014 rows=1 loops=4,104)

  • Output: p_3.value, pt_1.index, c_4.rate, pt_1.name
  • Inner Unique: true
  • Join Filter: (p_3.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=32882
67. 8.208 36.936 ↑ 1.0 1 4,104

Nested Loop (cost=0.57..6.14 rows=1 width=67) (actual time=0.009..0.009 rows=1 loops=4,104)

  • Output: p_3.value, p_3.currency_id, p_3.account_id, pt_1.index, pt_1.name
  • Inner Unique: true
  • Join Filter: (p_3.pricetype_id = pt_1.id)
  • Buffers: shared hit=24674
68. 16.416 16.416 ↑ 1.0 1 4,104

Index Scan using u__price__parent_id__pricetype_id on ms.price p_3 (cost=0.42..3.76 rows=1 width=56) (actual time=0.004..0.004 rows=1 loops=4,104)

  • Output: p_3.id, p_3.value, p_3.pricetype_id, p_3.currency_id, p_3.parent_id, p_3.account_id, p_3.owner_id, p_3.group_id, p_3.shared, p_3.ptype
  • Index Cond: (p_3.parent_id = deffeature.id)
  • Filter: (p_3.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=16466
69. 12.312 12.312 ↑ 1.0 1 4,104

Index Scan using i__pricetype__account_id on ms.pricetype pt_1 (cost=0.14..2.36 rows=1 width=43) (actual time=0.003..0.003 rows=1 loops=4,104)

  • Output: pt_1.id, pt_1.name, pt_1.index, pt_1.version, pt_1.updated, pt_1.updatedby, pt_1.deleted, pt_1.account_id, pt_1.owner_id, pt_1.group_id, pt_1.shared, pt_1.ptype, pt_1.externalcode
  • Index Cond: (pt_1.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=8208
70. 12.312 12.312 ↑ 1.0 1 4,104

Index Scan using currency_pkey on ms.currency c_4 (cost=0.14..2.37 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=4,104)

  • Output: c_4.id, c_4.version, c_4.deleted, c_4.updated, c_4.description, c_4.name, c_4.updatedby, c_4.code, c_4.rate, c_4.externalcode, c_4.major_s1, c_4.major_s24, c_4.major_s5, c_4.major_sex, c_4.minor_sex, c_4.minor_ (...)
  • Index Cond: (p_3.currency_id = c_4.id)
  • Filter: (c_4.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=8208
71. 12.312 178,035.624 ↑ 1.0 1 4,104

Aggregate (cost=6.30..6.31 rows=1 width=128) (actual time=43.381..43.381 rows=1 loops=4,104)

  • Output: array_agg(gp.id), array_agg(bc.barcode), array_agg(gp.quantity), array_agg(uom_1.name)
  • Buffers: shared hit=19469405
72. 24.624 178,023.312 ↓ 0.0 0 4,104

Merge Right Join (cost=5.43..6.27 rows=2 width=44) (actual time=43.378..43.378 rows=0 loops=4,104)

  • Output: gp.id, bc.barcode, gp.quantity, uom_1.name
  • Merge Cond: (bc.goodpack_id = gp.id)
  • Buffers: shared hit=19469405
73. 177,937.128 177,937.128 ↑ 11,672.0 1 4,104

Index Scan using i__barcode__goodpack_id on ms.barcode bc (cost=0.42..9,577.54 rows=11,672 width=29) (actual time=43.357..43.357 rows=1 loops=4,104)

  • Output: bc.id, bc.barcode, bc."position", bc.barcodetype, bc.consignment_id, bc.account_id, bc.owner_id, bc.group_id, bc.shared, bc.ptype, bc.goodpack_id
  • Filter: (bc.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Rows Removed by Filter: 227351
  • Buffers: shared hit=19461168
74. 32.832 61.560 ↓ 0.0 0 4,104

Sort (cost=5.01..5.02 rows=1 width=31) (actual time=0.015..0.015 rows=0 loops=4,104)

  • Output: gp.id, gp.quantity, uom_1.name
  • Sort Key: gp.id
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=8237
75. 8.208 28.728 ↓ 0.0 0 4,104

Nested Loop Left Join (cost=0.55..5.00 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=4,104)

  • Output: gp.id, gp.quantity, uom_1.name
  • Inner Unique: true
  • Buffers: shared hit=8237
76. 20.520 20.520 ↓ 0.0 0 4,104

Index Scan using goodpack_good_index on ms.goodpack gp (cost=0.28..2.50 rows=1 width=40) (actual time=0.005..0.005 rows=0 loops=4,104)

  • Output: gp.id, gp.quantity, gp.uom_id, gp.good_id, gp."position", gp.account_id, gp.owner_id, gp.group_id, gp.shared, gp.ptype
  • Index Cond: (gp.good_id = g.id)
  • Filter: (gp.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid)
  • Buffers: shared hit=8237
77. 0.000 0.000 ↓ 0.0 0

Index Scan using uom_pkey on ms.uom uom_1 (cost=0.27..2.49 rows=1 width=23) (never executed)

  • Output: uom_1.id, uom_1.version, uom_1.deleted, uom_1.updated, uom_1.description, uom_1.name, uom_1.type, uom_1.updatedby, uom_1.code, uom_1.externalcode, uom_1.favourite, uom_1.account_id, uom_1.owner_id, uom_1.group_ (...)
  • Index Cond: (gp.uom_id = uom_1.id)
78.          

SubPlan (for Nested Loop Left Join)

79. 36.936 61.560 ↑ 1.0 1 4,104

Aggregate (cost=2.64..2.65 rows=1 width=32) (actual time=0.014..0.015 rows=1 loops=4,104)

  • Output: array_agg(DISTINCT bc_1.barcode)
  • Buffers: shared hit=16476
80. 24.624 24.624 ↑ 1.0 1 4,104

Index Scan using i__barcode__consignment_id on ms.barcode bc_1 (cost=0.42..2.64 rows=1 width=13) (actual time=0.006..0.006 rows=1 loops=4,104)

  • Output: bc_1.id, bc_1.barcode, bc_1."position", bc_1.barcodetype, bc_1.consignment_id, bc_1.account_id, bc_1.owner_id, bc_1.group_id, bc_1.shared, bc_1.ptype, bc_1.goodpack_id
  • Index Cond: ((bc_1.account_id = '01733d5f-0e6b-11e8-7a69-9711001d1ead'::uuid) AND (bc_1.consignment_id = c.id))
  • Buffers: shared hit=16476
Planning time : 99.467 ms
Execution time : 178,853.336 ms