explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BC5d

Settings
# exclusive inclusive rows x rows loops node
1. 1.318 3,522.011 ↑ 1.0 1 1

Aggregate (cost=55,103.66..55,103.67 rows=1 width=32) (actual time=3,522.011..3,522.011 rows=1 loops=1)

2. 0.131 3,520.693 ↑ 1.0 50 1

Subquery Scan on tt (cost=3.80..55,103.53 rows=50 width=1,467) (actual time=3,499.343..3,520.693 rows=50 loops=1)

3. 0.000 3,520.562 ↑ 1.0 50 1

Limit (cost=3.80..55,103.03 rows=50 width=1,711) (actual time=3,499.322..3,520.562 rows=50 loops=1)

4.          

Initplan (for Limit)

5. 0.011 0.011 ↑ 1.0 1 1

Seq Scan on t_object_type ot (cost=0.00..1.10 rows=1 width=4) (actual time=0.010..0.011 rows=1 loops=1)

  • Filter: ((brief)::text = 'ITEM'::text)
  • Rows Removed by Filter: 7
6. 0.022 0.022 ↑ 1.0 1 1

Seq Scan on t_prop p_2 (cost=0.00..1.27 rows=1 width=4) (actual time=0.020..0.022 rows=1 loops=1)

  • Filter: ((brief)::text = 'AUTHORS'::text)
  • Rows Removed by Filter: 21
7. 15.384 3,520.532 ↑ 35.3 50 1

WindowAgg (cost=1.43..1,947,208.28 rows=1,767 width=1,711) (actual time=3,499.321..3,520.532 rows=50 loops=1)

8. 6.089 3,483.248 ↓ 3.7 6,536 1

Nested Loop Left Join (cost=1.43..1,231,403.01 rows=1,767 width=1,443) (actual time=3.679..3,483.248 rows=6,536 loops=1)

  • Join Filter: (tse.set_id = tsi.set_id)
  • Rows Removed by Join Filter: 52,284
9. 23.522 3,470.623 ↓ 3.7 6,536 1

Nested Loop Left Join (cost=1.43..1,231,193.97 rows=1,767 width=1,383) (actual time=3.662..3,470.623 rows=6,536 loops=1)

  • Join Filter: (i.item_id = tsi.item_id)
  • Rows Removed by Join Filter: 261,439
10. 4.594 3,427.493 ↓ 3.7 6,536 1

Nested Loop Left Join (cost=1.43..1,230,132.27 rows=1,767 width=1,379) (actual time=3.631..3,427.493 rows=6,536 loops=1)

11. 3.925 3,416.363 ↓ 3.7 6,536 1

Nested Loop Left Join (cost=1.28..1,229,831.84 rows=1,767 width=1,347) (actual time=3.607..3,416.363 rows=6,536 loops=1)

12. 7.948 3,386.294 ↓ 3.7 6,536 1

Nested Loop (cost=0.86..1,229,052.36 rows=1,767 width=1,327) (actual time=3.600..3,386.294 rows=6,536 loops=1)

  • Join Filter: (i.cat_id = c.cat_id)
  • Rows Removed by Join Filter: 13,975
13. 62.509 3,378.346 ↓ 3.3 6,649 1

Merge Semi Join (cost=0.86..1,228,858.99 rows=2,020 width=291) (actual time=3.579..3,378.346 rows=6,649 loops=1)

  • Merge Cond: (i.item_id = ip.item_id)
14. 345.888 345.888 ↑ 1.2 575,906 1

Index Scan Backward using t_item_pkey on t_item i (cost=0.42..33,921.23 rows=684,645 width=291) (actual time=0.013..345.888 rows=575,906 loops=1)

15. 743.019 2,969.949 ↓ 3.3 6,735 1

Index Scan Backward using t_item_prop_item_id_idx on t_item_prop ip (cost=0.43..1,198,841.60 rows=2,020 width=8) (actual time=3.386..2,969.949 rows=6,735 loops=1)

  • Index Cond: (prop_id = $13)
  • Filter: (object_id = (SubPlan 12))
  • Rows Removed by Filter: 735,575
16.          

SubPlan (for Index Scan Backward)

17. 2,226.930 2,226.930 ↓ 0.0 0 742,310

Index Scan using t_item_pkey on t_item ti3 (cost=0.42..2.65 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=742,310)

  • Index Cond: (item_id = ip.object_id)
  • Filter: ((name)::text ~* '^иванов'::text)
  • Rows Removed by Filter: 1
18. 0.000 0.000 ↑ 2.3 3 6,649

Materialize (cost=0.00..1.14 rows=7 width=1,036) (actual time=0.000..0.000 rows=3 loops=6,649)

19. 0.017 0.017 ↑ 1.0 7 1

Seq Scan on t_cat c (cost=0.00..1.10 rows=7 width=1,036) (actual time=0.012..0.017 rows=7 loops=1)

  • Filter: ((brief)::text <> 'AUTHORS'::text)
  • Rows Removed by Filter: 1
20. 26.144 26.144 ↑ 1.0 1 6,536

Index Scan using t_manufacturer_pkey on t_manufacturer m (cost=0.42..0.44 rows=1 width=28) (actual time=0.004..0.004 rows=1 loops=6,536)

  • Index Cond: (i.manufacturer_id = manufacturer_id)
21. 6.536 6.536 ↓ 0.0 0 6,536

Index Scan using pl_item on t_pline p (cost=0.15..0.17 rows=1 width=40) (actual time=0.001..0.001 rows=0 loops=6,536)

  • Index Cond: ((item_id = i.item_id) AND (pl_id = 1))
22. 19.594 19.608 ↑ 1.0 40 6,536

Materialize (cost=0.00..1.60 rows=40 width=8) (actual time=0.000..0.003 rows=40 loops=6,536)

23. 0.014 0.014 ↑ 1.0 40 1

Seq Scan on t_set_items tsi (cost=0.00..1.40 rows=40 width=8) (actual time=0.009..0.014 rows=40 loops=1)

24. 6.526 6.536 ↑ 1.0 8 6,536

Materialize (cost=0.00..1.12 rows=8 width=68) (actual time=0.000..0.001 rows=8 loops=6,536)

25. 0.010 0.010 ↑ 1.0 8 1

Seq Scan on t_set tse (cost=0.00..1.08 rows=8 width=68) (actual time=0.009..0.010 rows=8 loops=1)

26.          

SubPlan (for WindowAgg)

27. 0.000 0.200 ↑ 1.0 1 50

Aggregate (cost=2.24..2.25 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=50)

28. 0.050 0.200 ↓ 0.0 0 50

Nested Loop (cost=0.00..2.23 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=50)

29. 0.150 0.150 ↓ 0.0 0 50

Seq Scan on t_rating_link rl (cost=0.00..1.12 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=50)

  • Filter: (object_id = i.item_id)
  • Rows Removed by Filter: 10
30. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_object_type ot1 (cost=0.00..1.10 rows=1 width=0) (never executed)

  • Filter: ((brief)::text = 'ITEM'::text)
31. 0.050 0.150 ↑ 1.0 1 50

Aggregate (cost=2.24..2.25 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=50)

32. 0.050 0.100 ↓ 0.0 0 50

Nested Loop (cost=0.00..2.23 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=50)

33. 0.050 0.050 ↓ 0.0 0 50

Seq Scan on t_rating_link rl_1 (cost=0.00..1.12 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=50)

  • Filter: (object_id = i.item_id)
  • Rows Removed by Filter: 10
34. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_object_type ot1_1 (cost=0.00..1.10 rows=1 width=0) (never executed)

  • Filter: ((brief)::text = 'ITEM'::text)
35. 4.950 14.250 ↑ 1.0 1 50

Aggregate (cost=352.54..352.55 rows=1 width=32) (actual time=0.285..0.285 rows=1 loops=50)

36. 0.500 8.900 ↑ 5.4 18 50

Hash Join (cost=70.17..92.83 rows=98 width=709) (actual time=0.171..0.178 rows=18 loops=50)

  • Hash Cond: (pt.prop_type_id = p_1.type)
37. 0.100 0.100 ↑ 141.7 6 50

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=50)

38. 0.300 8.300 ↑ 1.3 18 50

Hash (cost=69.88..69.88 rows=23 width=677) (actual time=0.166..0.166 rows=18 loops=50)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
39. 0.845 8.000 ↑ 1.3 18 50

Nested Loop Left Join (cost=3.75..69.88 rows=23 width=677) (actual time=0.047..0.160 rows=18 loops=50)

40. 0.319 2.700 ↑ 1.3 18 50

Hash Join (cost=3.33..9.04 rows=23 width=628) (actual time=0.032..0.054 rows=18 loops=50)

  • Hash Cond: (cp.prop_id = p_1.prop_id)
41. 0.650 2.350 ↑ 1.3 18 50

Hash Right Join (cost=1.83..7.48 rows=23 width=108) (actual time=0.030..0.047 rows=18 loops=50)

  • Hash Cond: (ip_1.prop_id = cp.prop_id)
42. 1.150 1.150 ↑ 1.6 16 50

Index Scan using itm_id_idx on t_item_prop ip_1 (cost=0.43..5.75 rows=26 width=108) (actual time=0.016..0.023 rows=16 loops=50)

  • Index Cond: (item_id = i.item_id)
43. 0.150 0.550 ↑ 1.2 13 50

Hash (cost=1.20..1.20 rows=16 width=4) (actual time=0.011..0.011 rows=13 loops=50)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
44. 0.400 0.400 ↑ 1.2 13 50

Seq Scan on t_cat_prop cp (cost=0.00..1.20 rows=16 width=4) (actual time=0.004..0.008 rows=13 loops=50)

  • Filter: (cat_id = i.cat_id)
  • Rows Removed by Filter: 44
45. 0.019 0.031 ↑ 1.0 22 1

Hash (cost=1.22..1.22 rows=22 width=524) (actual time=0.031..0.031 rows=22 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
46. 0.012 0.012 ↑ 1.0 22 1

Seq Scan on t_prop p_1 (cost=0.00..1.22 rows=22 width=524) (actual time=0.009..0.012 rows=22 loops=1)

47. 4.455 4.455 ↑ 1.0 1 891

Index Scan using t_prop_value_pkey on t_prop_value pv (cost=0.43..2.65 rows=1 width=53) (actual time=0.005..0.005 rows=1 loops=891)

  • Index Cond: (prop_value_id = ip_1.prop_value_id)
48.          

SubPlan (for Aggregate)

49. 0.400 0.400 ↑ 1.0 1 100

Index Scan using t_item_pkey on t_item ti1 (cost=0.42..2.64 rows=1 width=59) (actual time=0.004..0.004 rows=1 loops=100)

  • Index Cond: (item_id = ip_1.object_id)
50. 0.000 5.900 ↑ 1.0 1 50

Aggregate (cost=29.24..29.25 rows=1 width=32) (actual time=0.118..0.118 rows=1 loops=50)

51. 0.100 5.900 ↓ 0.0 0 50

Nested Loop (cost=0.28..29.24 rows=1 width=100) (actual time=0.118..0.118 rows=0 loops=50)

52. 0.050 5.800 ↓ 0.0 0 50

Nested Loop (cost=0.00..26.74 rows=1 width=24) (actual time=0.116..0.116 rows=0 loops=50)

  • Join Filter: (fl.object_type_id = ot_1.object_type_id)
53. 0.100 0.100 ↑ 1.0 1 50

Seq Scan on t_object_type ot_1 (cost=0.00..1.10 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=50)

  • Filter: ((brief)::text = 'ITEM'::text)
  • Rows Removed by Filter: 7
54. 5.650 5.650 ↓ 0.0 0 50

Seq Scan on t_file_link fl (cost=0.00..25.60 rows=3 width=24) (actual time=0.113..0.113 rows=0 loops=50)

  • Filter: (object_id = i.item_id)
  • Rows Removed by Filter: 1,163
55. 0.000 0.000 ↓ 0.0 0

Index Scan using t_file_pkey on t_file f (cost=0.28..2.50 rows=1 width=80) (never executed)

  • Index Cond: (file_id = fl.file_id)
  • Filter: (NOT deleted)
56. 0.050 0.550 ↑ 1.0 1 50

Aggregate (cost=11.64..11.65 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=50)

57. 0.000 0.500 ↓ 0.0 0 50

Subquery Scan on affiliates (cost=11.48..11.62 rows=7 width=72) (actual time=0.010..0.010 rows=0 loops=50)

58. 0.050 0.500 ↓ 0.0 0 50

Unique (cost=11.48..11.55 rows=7 width=48) (actual time=0.010..0.010 rows=0 loops=50)

59. 0.250 0.450 ↓ 0.0 0 50

Sort (cost=11.48..11.50 rows=7 width=48) (actual time=0.009..0.009 rows=0 loops=50)

  • Sort Key: tt_1.subject_id, ts.name, ts.subject_id
  • Sort Method: quicksort Memory: 25kB
60. 0.000 0.200 ↓ 0.0 0 50

Merge Left Join (cost=0.93..11.38 rows=7 width=48) (actual time=0.004..0.004 rows=0 loops=50)

  • Merge Cond: (tt_1.subject_id = ts.subject_id)
61. 0.200 0.200 ↓ 0.0 0 50

Index Only Scan using t_tran_item_id_idx on t_tran tt_1 (cost=0.42..9.35 rows=7 width=4) (actual time=0.004..0.004 rows=0 loops=50)

  • Index Cond: (item_id = i.item_id)
  • Heap Fetches: 0
62. 0.000 0.000 ↓ 0.0 0

Index Scan using t_subject_pkey on t_subject ts (cost=0.14..5.64 rows=79 width=44) (never executed)

63. 0.100 0.850 ↑ 1.0 1 50

Aggregate (cost=7.11..7.12 rows=1 width=32) (actual time=0.017..0.017 rows=1 loops=50)

64.          

Initplan (for Aggregate)

65. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_object_type ot1_2 (cost=0.00..1.10 rows=1 width=4) (never executed)

  • Filter: ((brief)::text = 'ITEM'::text)
66. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_link_type tlt (cost=0.00..1.06 rows=1 width=8) (never executed)

  • Filter: ((brief)::text = 'TAG'::text)
67. 0.140 0.750 ↓ 0.0 0 50

Hash Semi Join (cost=2.83..4.94 rows=1 width=20) (actual time=0.015..0.015 rows=0 loops=50)

  • Hash Cond: (tt_2.tag_id = ttl.tag_id)
68. 0.010 0.010 ↑ 87.0 1 1

Seq Scan on t_tag tt_2 (cost=0.00..1.87 rows=87 width=28) (actual time=0.010..0.010 rows=1 loops=1)

69. 0.050 0.600 ↓ 0.0 0 50

Hash (cost=2.82..2.82 rows=1 width=8) (actual time=0.012..0.012 rows=0 loops=50)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
70. 0.550 0.550 ↓ 0.0 0 50

Seq Scan on t_tag_link ttl (cost=0.00..2.82 rows=1 width=8) (actual time=0.011..0.011 rows=0 loops=50)

  • Filter: ((object_id = i.item_id) AND (object_type_id = $10) AND (link_type_id = $11))
  • Rows Removed by Filter: 104
Planning time : 5.758 ms
Execution time : 3,523.306 ms