explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9YJA

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 5,703.581 ↑ 1.0 1 1

Limit (cost=74,683.58..74,683.59 rows=1 width=192) (actual time=5,703.580..5,703.581 rows=1 loops=1)

2.          

Initplan (for Limit)

3. 0.188 2.570 ↑ 1.0 1 1

Aggregate (cost=9,315.58..9,315.59 rows=1 width=32) (actual time=2.570..2.570 rows=1 loops=1)

4. 0.081 2.382 ↑ 126.9 1,119 1

Nested Loop (cost=0.70..8,960.68 rows=141,960 width=6) (actual time=0.685..2.382 rows=1,119 loops=1)

5. 0.591 1.361 ↑ 2.5 188 1

Nested Loop (cost=0.28..106.29 rows=463 width=8) (actual time=0.669..1.361 rows=188 loops=1)

  • Join Filter: (dt.doc_type_id = d.doc_type_id)
  • Rows Removed by Join Filter: 1754
6. 0.770 0.770 ↓ 1.0 1,942 1

Index Scan using t_doc_pkey on t_doc d (cost=0.28..77.44 rows=1,853 width=12) (actual time=0.012..0.770 rows=1,942 loops=1)

  • Filter: (NOT deleted)
7. 0.000 0.000 ↑ 1.0 1 1,942

Materialize (cost=0.00..1.05 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1,942)

8. 0.006 0.006 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'OUTDOC'::text)
  • Rows Removed by Filter: 3
9. 0.940 0.940 ↑ 68.5 6 188

Index Scan using doc_id_idx on t_tran tr (cost=0.42..15.01 rows=411 width=14) (actual time=0.002..0.005 rows=6 loops=188)

  • Index Cond: (doc_id = d.doc_id)
  • Filter: (NOT deleted)
10. 0.521 5,685.294 ↑ 1.0 1 1

Aggregate (cost=54,818.96..54,818.97 rows=1 width=32) (actual time=5,685.294..5,685.294 rows=1 loops=1)

11. 294.055 5,684.773 ↑ 423.1 1,136 1

Merge Left Join (cost=45,346.29..53,617.26 rows=480,677 width=6) (actual time=4,756.174..5,684.773 rows=1,136 loops=1)

  • Merge Cond: ((tr_1.barcode)::text = (tr_1_1.barcode)::text)
12. 4.456 6.680 ↑ 126.9 1,119 1

Sort (cost=22,531.70..22,886.60 rows=141,960 width=13) (actual time=6.421..6.680 rows=1,119 loops=1)

  • Sort Key: tr_1.barcode
  • Sort Method: quicksort Memory: 101kB
13. 0.166 2.224 ↑ 126.9 1,119 1

Nested Loop (cost=0.70..8,960.68 rows=141,960 width=13) (actual time=0.671..2.224 rows=1,119 loops=1)

14. 0.628 1.306 ↑ 2.5 188 1

Nested Loop (cost=0.28..106.29 rows=463 width=8) (actual time=0.661..1.306 rows=188 loops=1)

  • Join Filter: (dt_1.doc_type_id = d_1.doc_type_id)
  • Rows Removed by Join Filter: 1754
15. 0.678 0.678 ↓ 1.0 1,942 1

Index Scan using t_doc_pkey on t_doc d_1 (cost=0.28..77.44 rows=1,853 width=12) (actual time=0.009..0.678 rows=1,942 loops=1)

  • Filter: (NOT deleted)
16. 0.000 0.000 ↑ 1.0 1 1,942

Materialize (cost=0.00..1.05 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1,942)

17. 0.005 0.005 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'OUTDOC'::text)
  • Rows Removed by Filter: 3
18. 0.752 0.752 ↑ 68.5 6 188

Index Scan using doc_id_idx on t_tran tr_1 (cost=0.42..15.01 rows=411 width=21) (actual time=0.002..0.004 rows=6 loops=188)

  • Index Cond: (doc_id = d_1.doc_id)
  • Filter: (NOT deleted)
19. 93.680 5,384.038 ↓ 4.1 581,790 1

Materialize (cost=22,814.60..23,524.40 rows=141,960 width=19) (actual time=4,694.944..5,384.038 rows=581,790 loops=1)

20. 4,851.277 5,290.358 ↓ 4.1 581,783 1

Sort (cost=22,814.60..23,169.50 rows=141,960 width=19) (actual time=4,694.938..5,290.358 rows=581,783 loops=1)

  • Sort Key: tr_1_1.barcode
  • Sort Method: external merge Disk: 17696kB
21. 105.704 439.081 ↓ 4.1 582,889 1

Nested Loop (cost=0.70..8,960.68 rows=141,960 width=19) (actual time=0.085..439.081 rows=582,889 loops=1)

22. 1.985 3.917 ↓ 3.7 1,734 1

Nested Loop (cost=0.28..106.29 rows=463 width=8) (actual time=0.049..3.917 rows=1,734 loops=1)

  • Join Filter: (dt_1_1.doc_type_id = d_1_1.doc_type_id)
  • Rows Removed by Join Filter: 208
23. 1.932 1.932 ↓ 1.0 1,942 1

Index Scan using t_doc_pkey on t_doc d_1_1 (cost=0.28..77.44 rows=1,853 width=12) (actual time=0.020..1.932 rows=1,942 loops=1)

  • Filter: (NOT deleted)
24. 0.000 0.000 ↑ 1.0 1 1,942

Materialize (cost=0.00..1.05 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1,942)

25. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_1_1 (cost=0.00..1.05 rows=1 width=4) (actual time=0.010..0.014 rows=1 loops=1)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
26. 329.460 329.460 ↑ 1.2 336 1,734

Index Scan using doc_id_idx on t_tran tr_1_1 (cost=0.42..15.01 rows=411 width=27) (actual time=0.007..0.190 rows=336 loops=1,734)

  • Index Cond: (doc_id = d_1_1.doc_id)
  • Filter: (NOT deleted)
27. 0.011 2.018 ↑ 1.0 1 1

Aggregate (cost=9,315.58..9,315.59 rows=1 width=32) (actual time=2.018..2.018 rows=1 loops=1)

28. 0.011 2.007 ↑ 7,098.0 20 1

Nested Loop (cost=0.70..8,960.68 rows=141,960 width=6) (actual time=1.238..2.007 rows=20 loops=1)

29. 0.897 1.896 ↑ 23.1 20 1

Nested Loop (cost=0.28..106.29 rows=463 width=8) (actual time=1.212..1.896 rows=20 loops=1)

  • Join Filter: (dt_2.doc_type_id = d_2.doc_type_id)
  • Rows Removed by Join Filter: 1922
30. 0.999 0.999 ↓ 1.0 1,942 1

Index Scan using t_doc_pkey on t_doc d_2 (cost=0.28..77.44 rows=1,853 width=12) (actual time=0.028..0.999 rows=1,942 loops=1)

  • Filter: (NOT deleted)
31. 0.000 0.000 ↑ 1.0 1 1,942

Materialize (cost=0.00..1.05 rows=1 width=4) (actual time=0.000..0.000 rows=1 loops=1,942)

32. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_2 (cost=0.00..1.05 rows=1 width=4) (actual time=0.013..0.014 rows=1 loops=1)

  • Filter: ((brief)::text = 'BONUS_SELL'::text)
  • Rows Removed by Filter: 3
33. 0.100 0.100 ↑ 411.0 1 20

Index Scan using doc_id_idx on t_tran tr_2 (cost=0.42..15.01 rows=411 width=14) (actual time=0.005..0.005 rows=1 loops=20)

  • Index Cond: (doc_id = d_2.doc_id)
  • Filter: (NOT deleted)
34. 0.234 1.034 ↑ 1.0 1 1

Aggregate (cost=129.19..129.20 rows=1 width=8) (actual time=1.034..1.034 rows=1 loops=1)

35. 0.800 0.800 ↓ 1.0 2,908 1

Seq Scan on t_user (cost=0.00..121.95 rows=2,895 width=0) (actual time=0.019..0.800 rows=2,908 loops=1)

  • Filter: (NOT deleted)
36. 0.046 1.309 ↑ 1.0 1 1

Aggregate (cost=63.77..63.77 rows=1 width=8) (actual time=1.309..1.309 rows=1 loops=1)

37. 0.370 1.263 ↑ 2.5 188 1

Hash Join (cost=1.06..62.61 rows=463 width=0) (actual time=0.030..1.263 rows=188 loops=1)

  • Hash Cond: (d_3.doc_type_id = dt_3.doc_type_id)
38. 0.886 0.886 ↓ 1.0 1,942 1

Seq Scan on t_doc d_3 (cost=0.00..51.53 rows=1,853 width=4) (actual time=0.006..0.886 rows=1,942 loops=1)

  • Filter: (NOT deleted)
39. 0.002 0.007 ↑ 1.0 1 1

Hash (cost=1.05..1.05 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
40. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_3 (cost=0.00..1.05 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1)

  • Filter: ((brief)::text = 'OUTDOC'::text)
  • Rows Removed by Filter: 3
41. 0.150 1.194 ↑ 1.0 1 1

Aggregate (cost=63.77..63.77 rows=1 width=8) (actual time=1.194..1.194 rows=1 loops=1)

42. 0.407 1.044 ↓ 3.7 1,734 1

Hash Join (cost=1.06..62.61 rows=463 width=0) (actual time=0.030..1.044 rows=1,734 loops=1)

  • Hash Cond: (d_4.doc_type_id = dt_4.doc_type_id)
43. 0.629 0.629 ↓ 1.0 1,942 1

Seq Scan on t_doc d_4 (cost=0.00..51.53 rows=1,853 width=4) (actual time=0.008..0.629 rows=1,942 loops=1)

  • Filter: (NOT deleted)
44. 0.002 0.008 ↑ 1.0 1 1

Hash (cost=1.05..1.05 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
45. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_4 (cost=0.00..1.05 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=1)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
46. 0.004 0.602 ↑ 1.0 1 1

Aggregate (cost=63.77..63.77 rows=1 width=8) (actual time=0.602..0.602 rows=1 loops=1)

47. 0.185 0.598 ↑ 23.1 20 1

Hash Join (cost=1.06..62.61 rows=463 width=0) (actual time=0.030..0.598 rows=20 loops=1)

  • Hash Cond: (d_5.doc_type_id = dt_5.doc_type_id)
48. 0.404 0.404 ↓ 1.0 1,942 1

Seq Scan on t_doc d_5 (cost=0.00..51.53 rows=1,853 width=4) (actual time=0.005..0.404 rows=1,942 loops=1)

  • Filter: (NOT deleted)
49. 0.002 0.009 ↑ 1.0 1 1

Hash (cost=1.05..1.05 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
50. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_5 (cost=0.00..1.05 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=1)

  • Filter: ((brief)::text = 'BONUS_SELL'::text)
  • Rows Removed by Filter: 3
51. 0.005 0.028 ↑ 1.0 1 1

Aggregate (cost=2.09..2.10 rows=1 width=8) (actual time=0.028..0.028 rows=1 loops=1)

52. 0.007 0.023 ↓ 35.0 35 1

Nested Loop (cost=0.00..2.08 rows=1 width=0) (actual time=0.013..0.023 rows=35 loops=1)

  • Join Filter: (ttt.task_type_id = tt.type_id)
53. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on t_task_type ttt (cost=0.00..1.06 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

  • Filter: (brief = 'FEEDBACK'::text)
  • Rows Removed by Filter: 4
54. 0.010 0.010 ↓ 35.0 35 1

Seq Scan on t_task tt (cost=0.00..1.01 rows=1 width=4) (actual time=0.005..0.010 rows=35 loops=1)

  • Filter: (NOT deleted)
55. 0.004 0.051 ↑ 1.0 1 1

Aggregate (cost=7.80..7.81 rows=1 width=8) (actual time=0.051..0.051 rows=1 loops=1)

56. 0.026 0.047 ↑ 1.2 12 1

Hash Join (cost=1.02..7.76 rows=15 width=0) (actual time=0.032..0.047 rows=12 loops=1)

  • Hash Cond: (c.content_type_id = ct.content_type_id)
57. 0.014 0.014 ↑ 1.4 33 1

Seq Scan on t_content c (cost=0.00..6.45 rows=45 width=4) (actual time=0.006..0.014 rows=33 loops=1)

58. 0.002 0.007 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
59. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on t_content_type ct (cost=0.00..1.01 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Filter: ((brief)::text = 'NEWS'::text)
  • Rows Removed by Filter: 4
60. 0.008 0.031 ↑ 1.0 1 1

Aggregate (cost=7.80..7.81 rows=1 width=8) (actual time=0.031..0.031 rows=1 loops=1)

61. 0.012 0.023 ↑ 7.5 2 1

Hash Join (cost=1.02..7.76 rows=15 width=0) (actual time=0.021..0.023 rows=2 loops=1)

  • Hash Cond: (c_1.content_type_id = ct_1.content_type_id)
62. 0.007 0.007 ↑ 1.4 33 1

Seq Scan on t_content c_1 (cost=0.00..6.45 rows=45 width=4) (actual time=0.002..0.007 rows=33 loops=1)

63. 0.001 0.004 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
64. 0.003 0.003 ↑ 1.0 1 1

Seq Scan on t_content_type ct_1 (cost=0.00..1.01 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=1)

  • Filter: ((brief)::text = 'ARTICLES'::text)
  • Rows Removed by Filter: 4
65. 0.003 0.027 ↑ 1.0 1 1

Aggregate (cost=7.80..7.81 rows=1 width=8) (actual time=0.027..0.027 rows=1 loops=1)

66. 0.014 0.024 ↓ 1.1 17 1

Hash Join (cost=1.02..7.76 rows=15 width=0) (actual time=0.012..0.024 rows=17 loops=1)

  • Hash Cond: (c_2.content_type_id = ct_2.content_type_id)
67. 0.006 0.006 ↑ 1.4 33 1

Seq Scan on t_content c_2 (cost=0.00..6.45 rows=45 width=4) (actual time=0.002..0.006 rows=33 loops=1)

68. 0.001 0.004 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
69. 0.003 0.003 ↑ 1.0 1 1

Seq Scan on t_content_type ct_2 (cost=0.00..1.01 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=1)

  • Filter: ((brief)::text = 'INSTRUCTIONAL_VIDEOS'::text)
  • Rows Removed by Filter: 4
70. 0.000 1.401 ↑ 1.0 1 1

Aggregate (cost=257.51..257.52 rows=1 width=8) (actual time=1.401..1.401 rows=1 loops=1)

71. 0.344 1.411 ↑ 40.6 8 1

Hash Join (cost=1.12..256.69 rows=325 width=0) (actual time=0.024..1.411 rows=8 loops=1)

  • Hash Cond: (s.type_id = st.subject_type_id)
72. 1.060 1.060 ↓ 1.0 2,931 1

Seq Scan on t_subject s (cost=0.00..244.27 rows=2,927 width=4) (actual time=0.007..1.060 rows=2,931 loops=1)

  • Filter: (NOT deleted)
73. 0.002 0.007 ↑ 1.0 1 1

Hash (cost=1.11..1.11 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
74. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on t_subject_type st (cost=0.00..1.11 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1)

  • Filter: ((brief)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 4
75. 0.005 1.656 ↑ 1.0 1 1

Aggregate (cost=257.51..257.52 rows=1 width=8) (actual time=1.656..1.656 rows=1 loops=1)

76. 0.465 1.651 ↑ 54.2 6 1

Hash Join (cost=1.12..256.69 rows=325 width=0) (actual time=0.058..1.651 rows=6 loops=1)

  • Hash Cond: (s_1.type_id = st_1.subject_type_id)
77. 1.176 1.176 ↓ 1.0 2,931 1

Seq Scan on t_subject s_1 (cost=0.00..244.27 rows=2,927 width=4) (actual time=0.008..1.176 rows=2,931 loops=1)

  • Filter: (NOT deleted)
78. 0.003 0.010 ↑ 1.0 1 1

Hash (cost=1.11..1.11 rows=1 width=4) (actual time=0.010..0.010 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
79. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on t_subject_type st_1 (cost=0.00..1.11 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=1)

  • Filter: ((brief)::text = 'SELLER'::text)
  • Rows Removed by Filter: 4
80. 0.246 5.406 ↑ 1.0 1 1

Aggregate (cost=267.47..267.48 rows=1 width=8) (actual time=5.406..5.406 rows=1 loops=1)

81. 0.657 5.160 ↓ 3.7 1,734 1

Nested Loop (cost=1.34..266.31 rows=463 width=0) (actual time=0.045..5.160 rows=1,734 loops=1)

82. 0.443 1.035 ↓ 3.7 1,734 1

Hash Join (cost=1.06..62.61 rows=463 width=8) (actual time=0.032..1.035 rows=1,734 loops=1)

  • Hash Cond: (d_6.doc_type_id = dt_6.doc_type_id)
83. 0.585 0.585 ↓ 1.0 1,942 1

Seq Scan on t_doc d_6 (cost=0.00..51.53 rows=1,853 width=12) (actual time=0.014..0.585 rows=1,942 loops=1)

  • Filter: (NOT deleted)
84. 0.002 0.007 ↑ 1.0 1 1

Hash (cost=1.05..1.05 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
85. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_6 (cost=0.00..1.05 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
86. 3.468 3.468 ↑ 1.0 1 1,734

Index Scan using t_subject_pkey on t_subject s_2 (cost=0.28..0.44 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1,734)

  • Index Cond: (subject_id = d_6.partner_id)
  • Filter: (NOT deleted)
87. 0.131 0.928 ↑ 1.0 1 1

Aggregate (cost=104.85..104.86 rows=1 width=8) (actual time=0.928..0.928 rows=1 loops=1)

88. 0.161 0.797 ↓ 2.6 1,580 1

Nested Loop (cost=0.28..103.34 rows=604 width=0) (actual time=0.046..0.797 rows=1,580 loops=1)

89. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on t_cat c_3 (cost=0.00..1.04 rows=1 width=4) (actual time=0.009..0.010 rows=1 loops=1)

  • Filter: ((brief)::text = 'goods'::text)
  • Rows Removed by Filter: 2
90. 0.626 0.626 ↓ 1.7 1,580 1

Index Only Scan using cat_idx on t_item i (cost=0.28..93.25 rows=906 width=4) (actual time=0.035..0.626 rows=1,580 loops=1)

  • Index Cond: (cat_id = c_3.cat_id)
  • Heap Fetches: 1580
91. 5,703.579 5,703.579 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=192) (actual time=5,703.579..5,703.579 rows=1 loops=1)

Planning time : 2.741 ms
Execution time : 5,709.971 ms