explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6xSw

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 4,092.066 ↑ 1.0 1 1

Limit (cost=74,683.58..74,683.79 rows=1 width=192) (actual time=4,092.065..4,092.066 rows=1 loops=1)

2.          

Initplan (for Limit)

3. 0.166 2.801 ↑ 1.0 1 1

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

4. 0.208 2.635 ↑ 126.9 1,119 1

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

5. 0.663 1.487 ↑ 2.5 188 1

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

  • Join Filter: (dt.doc_type_id = d.doc_type_id)
  • Rows Removed by Join Filter: 1754
6. 0.824 0.824 ↓ 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.013..0.824 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.004 0.004 ↑ 1.0 1 1

Seq Scan on t_doc_type dt (cost=0.00..1.05 rows=1 width=4) (actual time=0.003..0.004 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.003..0.005 rows=6 loops=188)

  • Index Cond: (doc_id = d.doc_id)
  • Filter: (NOT deleted)
10. 0.378 4,076.392 ↑ 1.0 1 1

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

11. 217.034 4,076.014 ↑ 423.1 1,136 1

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

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

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

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

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

14. 0.672 1.377 ↑ 2.5 188 1

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

  • Join Filter: (dt_1.doc_type_id = d_1.doc_type_id)
  • Rows Removed by Join Filter: 1754
15. 0.705 0.705 ↓ 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.008..0.705 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.004..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. 71.851 3,852.973 ↓ 4.1 581,790 1

Materialize (cost=22,814.60..23,524.40 rows=141,960 width=19) (actual time=3,341.708..3,852.973 rows=581,790 loops=1)

20. 3,455.174 3,781.122 ↓ 4.1 581,783 1

Sort (cost=22,814.60..23,169.50 rows=141,960 width=19) (actual time=3,341.704..3,781.122 rows=581,783 loops=1)

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

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

22. 0.986 2.210 ↓ 3.7 1,734 1

Nested Loop (cost=0.28..106.29 rows=463 width=8) (actual time=0.045..2.210 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.224 1.224 ↓ 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.032..1.224 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.008 0.008 ↑ 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.004..0.008 rows=1 loops=1)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
26. 242.760 242.760 ↑ 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.005..0.140 rows=336 loops=1,734)

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

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

28. 0.008 1.553 ↑ 7,098.0 20 1

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

29. 0.674 1.465 ↑ 23.1 20 1

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

  • Join Filter: (dt_2.doc_type_id = d_2.doc_type_id)
  • Rows Removed by Join Filter: 1922
30. 0.791 0.791 ↓ 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.025..0.791 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.009 0.009 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'BONUS_SELL'::text)
  • Rows Removed by Filter: 3
33. 0.080 0.080 ↑ 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.004..0.004 rows=1 loops=20)

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

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

35. 0.723 0.723 ↓ 1.0 2,908 1

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

  • Filter: (NOT deleted)
36. 0.017 0.639 ↑ 1.0 1 1

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

37. 0.195 0.622 ↑ 2.5 188 1

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

  • Hash Cond: (d_3.doc_type_id = dt_3.doc_type_id)
38. 0.421 0.421 ↓ 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.004..0.421 rows=1,942 loops=1)

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

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

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

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

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

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

42. 0.362 0.803 ↓ 3.7 1,734 1

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

  • Hash Cond: (d_4.doc_type_id = dt_4.doc_type_id)
43. 0.433 0.433 ↓ 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.003..0.433 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.578 ↑ 1.0 1 1

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

47. 0.193 0.574 ↑ 23.1 20 1

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

  • Hash Cond: (d_5.doc_type_id = dt_5.doc_type_id)
48. 0.377 0.377 ↓ 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.004..0.377 rows=1,942 loops=1)

  • Filter: (NOT deleted)
49. 0.001 0.004 ↑ 1.0 1 1

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

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

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

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

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

52. 0.006 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.005 0.005 ↑ 1.0 1 1

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

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

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

  • Filter: (NOT deleted)
55. 0.003 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.015 0.048 ↑ 1.2 12 1

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

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

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

58. 0.001 0.006 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=4) (actual time=0.006..0.006 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.001 0.030 ↑ 1.0 1 1

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

61. 0.018 0.029 ↑ 7.5 2 1

Hash Join (cost=1.02..7.76 rows=15 width=0) (actual time=0.027..0.029 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.005 0.041 ↑ 1.0 1 1

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

66. 0.013 0.036 ↓ 1.1 17 1

Hash Join (cost=1.02..7.76 rows=15 width=0) (actual time=0.024..0.036 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.014 0.017 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=4) (actual time=0.017..0.017 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.003..0.003 rows=1 loops=1)

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

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

71. 0.311 1.314 ↑ 40.6 8 1

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

  • Hash Cond: (s.type_id = st.subject_type_id)
72. 0.979 0.979 ↓ 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..0.979 rows=2,931 loops=1)

  • Filter: (NOT deleted)
73. 0.019 0.024 ↑ 1.0 1 1

Hash (cost=1.11..1.11 rows=1 width=4) (actual time=0.024..0.024 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.002 0.986 ↑ 1.0 1 1

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

76. 0.320 0.984 ↑ 54.2 6 1

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

  • Hash Cond: (s_1.type_id = st_1.subject_type_id)
77. 0.656 0.656 ↓ 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.005..0.656 rows=2,931 loops=1)

  • Filter: (NOT deleted)
78. 0.001 0.008 ↑ 1.0 1 1

Hash (cost=1.11..1.11 rows=1 width=4) (actual time=0.008..0.008 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.007..0.007 rows=1 loops=1)

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

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

81. 0.076 4.470 ↓ 3.7 1,734 1

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

82. 0.443 0.926 ↓ 3.7 1,734 1

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

  • Hash Cond: (d_6.doc_type_id = dt_6.doc_type_id)
83. 0.478 0.478 ↓ 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.004..0.478 rows=1,942 loops=1)

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

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

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

Seq Scan on t_doc_type dt_6 (cost=0.00..1.05 rows=1 width=4) (actual time=0.003..0.003 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.143 0.986 ↑ 1.0 1 1

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

88. 0.173 0.843 ↓ 2.6 1,580 1

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

89. 0.008 0.008 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'goods'::text)
  • Rows Removed by Filter: 2
90. 0.662 0.662 ↓ 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.043..0.662 rows=1,580 loops=1)

  • Index Cond: (cat_id = c_3.cat_id)
  • Heap Fetches: 1580
91. 4,092.063 4,092.063 ↑ 5.0 1 1

Seq Scan on t_settings (cost=0.00..1.05 rows=5 width=192) (actual time=4,092.063..4,092.063 rows=1 loops=1)

Planning time : 2.872 ms
Execution time : 4,097.324 ms