explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tnN9

Settings
# exclusive inclusive rows x rows loops node
1. 23.432 165.473 ↑ 4.0 2,613 1

WindowAgg (cost=586.30..428,790.94 rows=10,448 width=1,412) (actual time=124.162..165.473 rows=2,613 loops=1)

2.          

CTE vl_params

3. 0.015 0.015 ↑ 1.0 1 1

Function Scan on params (cost=0.01..0.14 rows=1 width=218) (actual time=0.015..0.015 rows=1 loops=1)

4. 1.132 118.524 ↑ 4.0 2,613 1

Nested Loop Left Join (cost=586.16..84,241.88 rows=10,448 width=840) (actual time=6.752..118.524 rows=2,613 loops=1)

5. 2.316 112.166 ↓ 1.0 2,613 1

Nested Loop Left Join (cost=581.97..50,882.63 rows=2,612 width=840) (actual time=6.739..112.166 rows=2,613 loops=1)

6. 1.781 13.206 ↑ 1.0 2,612 1

Hash Join (cost=571.29..1,150.15 rows=2,612 width=800) (actual time=6.594..13.206 rows=2,612 loops=1)

  • Hash Cond: (nu.id_usr = u.acc_id_usr)
7. 0.981 5.134 ↑ 1.0 2,612 1

Hash Join (cost=29.90..572.85 rows=2,612 width=686) (actual time=0.247..5.134 rows=2,612 loops=1)

  • Hash Cond: (nu.kd_entity = me.kd_entity)
8. 2.579 3.997 ↑ 1.0 2,612 1

Hash Join (cost=3.17..510.20 rows=2,612 width=686) (actual time=0.081..3.997 rows=2,612 loops=1)

  • Hash Cond: (nu.kd_m_unit = mu.kd_m_unit)
9. 1.362 1.362 ↑ 1.0 2,612 1

Seq Scan on sl_nomenclature_unit nu (cost=0.00..471.12 rows=2,612 width=653) (actual time=0.011..1.362 rows=2,612 loops=1)

10. 0.020 0.056 ↓ 1.0 67 1

Hash (cost=2.34..2.34 rows=66 width=37) (actual time=0.056..0.056 rows=67 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
11. 0.011 0.036 ↓ 1.0 67 1

Nested Loop (cost=0.00..2.34 rows=66 width=37) (actual time=0.025..0.036 rows=67 loops=1)

12. 0.017 0.017 ↑ 1.0 1 1

CTE Scan on vl_params par (cost=0.00..0.02 rows=1 width=0) (actual time=0.017..0.017 rows=1 loops=1)

13. 0.008 0.008 ↓ 1.0 67 1

Seq Scan on m_measure_unit mu (cost=0.00..1.66 rows=66 width=37) (actual time=0.006..0.008 rows=67 loops=1)

14. 0.069 0.156 ↑ 1.2 482 1

Hash (cost=19.66..19.66 rows=566 width=4) (actual time=0.156..0.156 rows=482 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
15. 0.087 0.087 ↑ 1.2 482 1

Seq Scan on m_entity me (cost=0.00..19.66 rows=566 width=4) (actual time=0.005..0.087 rows=482 loops=1)

16. 3.599 6.291 ↑ 1.0 9,795 1

Hash (cost=418.95..418.95 rows=9,795 width=120) (actual time=6.291..6.291 rows=9,795 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 1,342kB
17. 2.692 2.692 ↑ 1.0 9,795 1

Seq Scan on acc_user u (cost=0.00..418.95 rows=9,795 width=120) (actual time=0.005..2.692 rows=9,795 loops=1)

18. 52.236 96.644 ↑ 1.0 1 2,612

GroupAggregate (cost=10.69..19.02 rows=1 width=64) (actual time=0.037..0.037 rows=1 loops=2,612)

  • Group Key: splr.id_unit_item, plr.id_dict_tp_price
19. 5.224 39.180 ↑ 1.0 1 2,612

Sort (cost=10.69..10.69 rows=1 width=568) (actual time=0.015..0.015 rows=1 loops=2,612)

  • Sort Key: plr.id_dict_tp_price
  • Sort Method: quicksort Memory: 25kB
20. 15.672 33.956 ↑ 1.0 1 2,612

Hash Join (cost=8.31..10.68 rows=1 width=568) (actual time=0.008..0.013 rows=1 loops=2,612)

  • Hash Cond: (plr.id_price_list = splr.id_price_list)
21. 10.448 10.448 ↓ 1.3 34 2,612

Seq Scan on sl_price_list plr (cost=0.00..2.26 rows=26 width=552) (actual time=0.001..0.004 rows=34 loops=2,612)

22. 0.000 7.836 ↑ 1.0 1 2,612

Hash (cost=8.30..8.30 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=2,612)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
23. 7.836 7.836 ↑ 1.0 1 2,612

Index Scan using sl_price_list_row_i1 on sl_price_list_row splr (cost=0.28..8.30 rows=1 width=32) (actual time=0.002..0.003 rows=1 loops=2,612)

  • Index Cond: (id_unit_item = nu.id_unit_item)
24.          

SubPlan (for GroupAggregate)

25. 0.000 5.228 ↑ 1.0 1 2,614

Append (cost=0.28..8.30 rows=1 width=55) (actual time=0.002..0.002 rows=1 loops=2,614)

26. 5.228 5.228 ↑ 1.0 1 2,614

Index Scan using d_dict_key on d_dict a_3 (cost=0.28..8.30 rows=1 width=55) (actual time=0.002..0.002 rows=1 loops=2,614)

  • Index Cond: ((id_dict = plr.id_dict_tp_price) AND (kd_dict_entity = 131))
27. 2.613 5.226 ↓ 0.0 0 2,613

GroupAggregate (cost=4.18..12.69 rows=4 width=24) (actual time=0.002..0.002 rows=0 loops=2,613)

  • Group Key: d.id_unit_item
28. 0.000 2.613 ↓ 0.0 0 2,613

Bitmap Heap Scan on sl_doc_nomenclature d (cost=4.18..12.64 rows=4 width=16) (actual time=0.001..0.001 rows=0 loops=2,613)

  • Recheck Cond: (id_unit_item = nu.id_unit_item)
  • Heap Blocks: exact=3
29. 2.613 2.613 ↓ 0.0 0 2,613

Bitmap Index Scan on sl_doc_nomenclature_i1 (cost=0.00..4.18 rows=4 width=0) (actual time=0.001..0.001 rows=0 loops=2,613)

  • Index Cond: (id_unit_item = nu.id_unit_item)
30.          

SubPlan (for WindowAgg)

31. 2.613 2.613 ↑ 1.0 1 2,613

Index Scan using d_facility_ak1 on d_facility f (cost=0.14..8.15 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=2,613)

  • Index Cond: (id_dict = nu.id_dict_facility)
32. 0.000 5.226 ↑ 1.0 1 2,613

Append (cost=0.29..8.30 rows=1 width=55) (actual time=0.002..0.002 rows=1 loops=2,613)

33. 5.226 5.226 ↑ 1.0 1 2,613

Index Scan using d_dict_key on d_dict a (cost=0.29..8.30 rows=1 width=55) (actual time=0.001..0.002 rows=1 loops=2,613)

  • Index Cond: ((id_dict = ((nu.data ->> 'KD_VD_UNIT'::text))::bigint) AND (kd_dict_entity = 129))
34. 0.000 15.678 ↓ 0.0 0 2,613

Append (cost=0.29..16.47 rows=2 width=286) (actual time=0.005..0.006 rows=0 loops=2,613)

35. 2.613 2.613 ↓ 0.0 0 2,613

Index Scan using d_dict_key on d_dict a_1 (cost=0.29..8.30 rows=1 width=55) (actual time=0.001..0.001 rows=0 loops=2,613)

  • Index Cond: ((id_dict = ((nu.data ->> 'KD_NOM_UNIT_CAT'::text))::bigint) AND (kd_dict_entity = 155))
36. 13.065 13.065 ↓ 0.0 0 2,613

Index Scan using d_unit_item_category_kd_dict_entity_idx on d_unit_item_category a_2 (cost=0.14..8.17 rows=1 width=516) (actual time=0.003..0.005 rows=0 loops=2,613)

  • Index Cond: (kd_dict_entity = 155)
  • Filter: (id_dict = ((nu.data ->> 'KD_NOM_UNIT_CAT'::text))::bigint)
  • Rows Removed by Filter: 9