explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JNW0

Settings
# exclusive inclusive rows x rows loops node
1. 1.071 2,810.338 ↑ 1.0 1 1

Aggregate (cost=3,107.62..3,107.63 rows=1 width=32) (actual time=2,810.338..2,810.338 rows=1 loops=1)

2. 0.186 2,809.267 ↑ 1.0 20 1

Subquery Scan on tt (cost=1.67..3,107.57 rows=20 width=2,048) (actual time=288.124..2,809.267 rows=20 loops=1)

3. 0.029 2,809.081 ↑ 1.0 20 1

Limit (cost=1.67..3,107.37 rows=20 width=2,776) (actual time=288.101..2,809.081 rows=20 loops=1)

4.          

Initplan (for Limit)

5. 0.018 0.018 ↑ 1.0 1 1

Seq Scan on t_object_type ot (cost=0.00..1.11 rows=1 width=4) (actual time=0.016..0.018 rows=1 loops=1)

  • Filter: ((brief)::text = 'ITEM'::text)
  • Rows Removed by Filter: 8
6. 3.076 2,809.034 ↑ 84.0 20 1

WindowAgg (cost=0.56..261,034.56 rows=1,681 width=2,776) (actual time=288.100..2,809.034 rows=20 loops=1)

7. 1.686 143.258 ↑ 1.2 1,458 1

Nested Loop Left Join (cost=0.56..933.17 rows=1,681 width=1,959) (actual time=2.009..143.258 rows=1,458 loops=1)

  • Join Filter: (i.item_id = ic.item_id)
  • Rows Removed by Join Filter: 4371
8. 1.548 141.572 ↑ 1.2 1,458 1

Nested Loop Left Join (cost=0.56..856.49 rows=1,681 width=1,541) (actual time=1.987..141.572 rows=1,458 loops=1)

9. 0.682 134.192 ↑ 1.2 1,458 1

Nested Loop Left Join (cost=0.28..278.36 rows=1,681 width=1,536) (actual time=0.061..134.192 rows=1,458 loops=1)

  • Join Filter: (i.manufacturer_id = m.manufacturer_id)
  • Rows Removed by Join Filter: 28
10. 1.244 133.510 ↑ 1.2 1,458 1

Nested Loop Left Join (cost=0.28..252.13 rows=1,681 width=1,508) (actual time=0.026..133.510 rows=1,458 loops=1)

  • Join Filter: (c.cat_id = i.cat_id)
  • Rows Removed by Join Filter: 1463
11. 132.266 132.266 ↑ 1.2 1,458 1

Index Scan Backward using t_item_pkey on t_item i (cost=0.28..188.05 rows=1,681 width=472) (actual time=0.013..132.266 rows=1,458 loops=1)

  • Filter: (NOT is_disabled)
  • Rows Removed by Filter: 128
12. 0.000 0.000 ↑ 1.5 2 1,458

Materialize (cost=0.00..1.04 rows=3 width=1,036) (actual time=0.000..0.000 rows=2 loops=1,458)

13. 0.007 0.007 ↑ 1.0 3 1

Seq Scan on t_cat c (cost=0.00..1.03 rows=3 width=1,036) (actual time=0.006..0.007 rows=3 loops=1)

14. 0.000 0.000 ↑ 1.0 1 1,458

Materialize (cost=0.00..1.01 rows=1 width=36) (actual time=0.000..0.000 rows=1 loops=1,458)

15. 0.018 0.018 ↑ 1.0 1 1

Seq Scan on t_manufacturer m (cost=0.00..1.01 rows=1 width=36) (actual time=0.017..0.018 rows=1 loops=1)

16. 5.832 5.832 ↑ 1.0 1 1,458

Index Scan using pl_item on t_pline p (cost=0.28..0.34 rows=1 width=13) (actual time=0.004..0.004 rows=1 loops=1,458)

  • Index Cond: ((item_id = i.item_id) AND (pl_id = 1))
17. 0.000 0.000 ↑ 1.0 3 1,458

Materialize (cost=0.00..1.04 rows=3 width=426) (actual time=0.000..0.000 rows=3 loops=1,458)

18. 0.013 0.013 ↑ 1.0 3 1

Seq Scan on t_icode ic (cost=0.00..1.03 rows=3 width=426) (actual time=0.013..0.013 rows=3 loops=1)

19.          

SubPlan (for WindowAgg)

20. 0.205 6.960 ↓ 0.0 0 20

Nested Loop (cost=0.00..54.27 rows=1 width=516) (actual time=0.285..0.348 rows=0 loops=20)

  • Join Filter: (ip.prop_value_id = pv.prop_value_id)
  • Rows Removed by Join Filter: 2
21. 0.060 6.740 ↓ 0.0 0 20

Nested Loop (cost=0.00..52.97 rows=1 width=4) (actual time=0.274..0.337 rows=0 loops=20)

  • Join Filter: (ip.prop_id = p_1.prop_id)
  • Rows Removed by Join Filter: 1
22. 0.100 0.100 ↑ 1.0 1 20

Seq Scan on t_prop p_1 (cost=0.00..1.09 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=20)

  • Filter: ((brief)::text = 'GROUP'::text)
  • Rows Removed by Filter: 7
23. 6.580 6.580 ↑ 2.0 1 20

Seq Scan on t_item_prop ip (cost=0.00..51.86 rows=2 width=8) (actual time=0.217..0.329 rows=1 loops=20)

  • Filter: (item_id = i.item_id)
  • Rows Removed by Filter: 2662
24. 0.015 0.015 ↑ 1.2 11 3

Seq Scan on t_prop_value pv (cost=0.00..1.13 rows=13 width=520) (actual time=0.004..0.005 rows=11 loops=3)

25. 1.060 34.680 ↑ 1.0 1 20

Aggregate (cost=77.80..77.81 rows=1 width=32) (actual time=1.734..1.734 rows=1 loops=20)

26. 0.276 33.620 ↓ 1.2 5 20

Nested Loop (cost=1.16..77.78 rows=4 width=1,176) (actual time=0.329..1.681 rows=5 loops=20)

  • Join Filter: (p_2.prop_id = cp.prop_id)
  • Rows Removed by Join Filter: 36
27. 0.464 32.720 ↓ 5.0 5 20

Nested Loop Left Join (cost=0.00..54.26 rows=1 width=624) (actual time=0.316..1.636 rows=5 loops=20)

  • Join Filter: (pv_1.prop_value_id = ip_1.prop_value_id)
  • Rows Removed by Join Filter: 73
28. 0.312 31.840 ↓ 5.0 5 20

Nested Loop Left Join (cost=0.00..52.96 rows=1 width=108) (actual time=0.304..1.592 rows=5 loops=20)

  • Join Filter: (ip_1.prop_id = cp.prop_id)
  • Rows Removed by Join Filter: 6
29. 0.120 0.120 ↓ 5.0 5 20

Seq Scan on t_cat_prop cp (cost=0.00..1.07 rows=1 width=4) (actual time=0.004..0.006 rows=5 loops=20)

  • Filter: (cat_id = i.cat_id)
  • Rows Removed by Filter: 3
30. 31.408 31.408 ↑ 2.0 1 104

Seq Scan on t_item_prop ip_1 (cost=0.00..51.86 rows=2 width=108) (actual time=0.197..0.302 rows=1 loops=104)

  • Filter: (item_id = i.item_id)
  • Rows Removed by Filter: 2662
31. 0.416 0.416 ↓ 1.1 14 104

Seq Scan on t_prop_value pv_1 (cost=0.00..1.13 rows=13 width=520) (actual time=0.003..0.004 rows=14 loops=104)

32. 0.401 0.624 ↑ 3.8 8 104

Hash Join (cost=1.16..23.14 rows=30 width=556) (actual time=0.003..0.006 rows=8 loops=104)

  • Hash Cond: (pt.prop_type_id = p_2.type)
33. 0.208 0.208 ↑ 141.7 6 104

Seq Scan on t_prop_type pt (cost=0.00..18.50 rows=850 width=36) (actual time=0.001..0.002 rows=6 loops=104)

34. 0.008 0.015 ↓ 1.1 8 1

Hash (cost=1.07..1.07 rows=7 width=524) (actual time=0.015..0.015 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
35. 0.007 0.007 ↓ 1.1 8 1

Seq Scan on t_prop p_2 (cost=0.00..1.07 rows=7 width=524) (actual time=0.005..0.007 rows=8 loops=1)

36. 0.180 1.140 ↑ 1.0 1 20

Aggregate (cost=8.61..8.62 rows=1 width=32) (actual time=0.057..0.057 rows=1 loops=20)

37. 0.960 0.960 ↓ 0.0 0 20

Seq Scan on t_item_image ii (cost=0.00..8.60 rows=1 width=47) (actual time=0.038..0.048 rows=0 loops=20)

  • Filter: (item_id = i.item_id)
  • Rows Removed by Filter: 292
38. 0.080 2,619.920 ↓ 0.0 0 20

Limit (cost=0.42..14.01 rows=1 width=32) (actual time=130.996..130.996 rows=0 loops=20)

39. 2.970 2,619.840 ↓ 0.0 0 20

Nested Loop (cost=0.42..5,964.31 rows=439 width=32) (actual time=130.992..130.992 rows=0 loops=20)

40. 8.540 13.920 ↓ 3.2 1,240 20

Nested Loop (cost=0.00..66.45 rows=382 width=8) (actual time=0.009..0.696 rows=1,240 loops=20)

  • Join Filter: (dt.doc_type_id = d.doc_type_id)
  • Rows Removed by Join Filter: 101
41. 0.080 0.080 ↑ 1.0 1 20

Seq Scan on t_doc_type dt (cost=0.00..1.05 rows=1 width=4) (actual time=0.002..0.004 rows=1 loops=20)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 2
42. 5.300 5.300 ↑ 1.1 1,340 20

Seq Scan on t_doc d (cost=0.00..46.29 rows=1,529 width=12) (actual time=0.004..0.265 rows=1,340 loops=20)

43. 2,602.950 2,602.950 ↓ 0.0 0 24,790

Index Scan using doc_id_idx on t_tran tr (cost=0.42..15.41 rows=2 width=14) (actual time=0.105..0.105 rows=0 loops=24,790)

  • Index Cond: (doc_id = d.doc_id)
  • Filter: (item_id = i.item_id)
  • Rows Removed by Filter: 326
Planning time : 10.705 ms
Execution time : 2,810.876 ms