explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wXH4

Settings
# exclusive inclusive rows x rows loops node
1. 1.195 2,603.400 ↑ 1.0 1 1

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

2. 0.184 2,602.205 ↑ 1.0 20 1

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

3. 0.019 2,602.021 ↑ 1.0 20 1

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

4.          

Initplan (for Limit)

5. 0.015 0.015 ↑ 1.0 1 1

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

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

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

7. 1.268 13.599 ↑ 1.2 1,458 1

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

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

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

9. 0.479 9.273 ↑ 1.2 1,458 1

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

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

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

  • Join Filter: (c.cat_id = i.cat_id)
  • Rows Removed by Join Filter: 1463
11. 1.589 1.589 ↑ 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.012..1.589 rows=1,458 loops=1)

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

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

13. 4.767 4.767 ↑ 1.0 3 1

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

14. 0.076 1.458 ↑ 1.0 1 1,458

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

15. 1.382 1.382 ↑ 1.0 1 1

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

16. 2.916 2.916 ↑ 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.002..0.002 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.018 0.018 ↑ 1.0 3 1

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

19.          

SubPlan (for WindowAgg)

20. 0.325 7.460 ↓ 0.0 0 20

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

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

Nested Loop (cost=0.00..52.97 rows=1 width=4) (actual time=0.317..0.356 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.005..0.005 rows=1 loops=20)

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

Seq Scan on t_item_prop ip (cost=0.00..51.86 rows=2 width=8) (actual time=0.253..0.348 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.300 37.080 ↑ 1.0 1 20

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

26. 0.272 35.780 ↓ 1.2 5 20

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

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

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

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

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

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

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

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

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

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

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

32. 0.511 0.728 ↑ 3.8 8 104

Hash Join (cost=1.16..23.14 rows=30 width=556) (actual time=0.003..0.007 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.005 0.009 ↓ 1.1 8 1

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

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

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

36. 0.120 1.220 ↑ 1.0 1 20

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

37. 1.100 1.100 ↓ 0.0 0 20

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

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

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

39. 20.230 2,540.080 ↓ 0.0 0 20

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

40. 9.660 16.060 ↓ 3.2 1,240 20

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

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

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

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 2
42. 6.300 6.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.005..0.315 rows=1,340 loops=20)

43. 2,503.790 2,503.790 ↓ 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.101..0.101 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 : 33.181 ms
Execution time : 2,603.924 ms