explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nOtd

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

Sort (cost=17,837.69..17,838.19 rows=200 width=72) (actual rows= loops=)

  • Sort Key: s.id, p.id, (CASE WHEN (count(smhatv.id_product_attribute_value) > 0) THEN string_agg(concat(smhatv.id_product_attribute_value, ''), ','::text ORDER BY smhatv.id_product_attribute_value) ELSE ''::text END)
2. 0.000 0.000 ↓ 0.0

HashAggregate (cost=17,827.55..17,830.05 rows=200 width=72) (actual rows= loops=)

  • Group Key: s.id, p.id, CASE WHEN (count(smhatv.id_product_attribute_value) > 0) THEN string_agg(concat(smhatv.id_product_attribute_value, ''), ','::text ORDER BY smhatv.id_product_attribute_value) ELSE ''::text END
3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=17,697.68..17,789.07 rows=1,924 width=36) (actual rows= loops=)

  • Group Key: sm.id, smc.id, p.id, s.id
4. 0.000 0.000 ↓ 0.0

Sort (cost=17,697.68..17,702.49 rows=1,924 width=36) (actual rows= loops=)

  • Sort Key: sm.id, smc.id, p.id, s.id
5. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=6,326.51..17,592.72 rows=1,924 width=36) (actual rows= loops=)

  • Hash Cond: (sm.id = smhatv.id_stock_movement)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6,325.49..17,584.48 rows=1,924 width=32) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.28..9.52 rows=1 width=8) (actual rows= loops=)

  • Join Filter: (u.id = p.id_unit_of_measure)
8. 0.000 0.000 ↓ 0.0

Index Scan using product_pkey on product p (cost=0.28..8.29 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = 280)
  • Filter: ((NOT disabled) AND (NOT type_service))
9. 0.000 0.000 ↓ 0.0

Seq Scan on unit_of_measure u (cost=0.00..1.10 rows=10 width=8) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6,325.21..17,555.72 rows=1,924 width=28) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..3.30 rows=1 width=12) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..2.21 rows=1 width=8) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on status st (cost=0.00..1.06 rows=1 width=4) (actual rows= loops=)

  • Filter: (id = 2)
14. 0.000 0.000 ↓ 0.0

Seq Scan on stock_company sc (cost=0.00..1.14 rows=1 width=4) (actual rows= loops=)

  • Filter: ((id_stock = 2) AND (id_company = 2))
15. 0.000 0.000 ↓ 0.0

Seq Scan on stock s (cost=0.00..1.09 rows=1 width=4) (actual rows= loops=)

  • Filter: ((NOT disabled) AND (id = 2))
16. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=6,325.21..17,533.17 rows=1,924 width=32) (actual rows= loops=)

  • Hash Cond: (smc.id_stock_moviment_out = sm.id)
17. 0.000 0.000 ↓ 0.0

Seq Scan on stock_movement_cost smc (cost=0.00..9,068.48 rows=424,148 width=13) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=6,301.16..6,301.16 rows=1,924 width=23) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on stock_movement sm (cost=1,879.62..6,301.16 rows=1,924 width=23) (actual rows= loops=)

  • Recheck Cond: ((id_product = 280) AND (id_stock = 2))
  • Filter: ((NOT disabled) AND (id_status = 2))
20. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=1,879.62..1,879.62 rows=1,963 width=0) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on u18710_stock_movement_id_product_index (cost=0.00..216.32 rows=10,120 width=0) (actual rows= loops=)

  • Index Cond: (id_product = 280)
22. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on u18710_stock_movement_id_stock_index (cost=0.00..1,662.08 rows=84,488 width=0) (actual rows= loops=)

  • Index Cond: (id_stock = 2)
23. 0.000 0.000 ↓ 0.0

Hash (cost=1.01..1.01 rows=1 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on stock_movement_has_attribute_value smhatv (cost=0.00..1.01 rows=1 width=8) (actual rows= loops=)