explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w7Fu

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 717.659 ↑ 1.0 1 1

Limit (cost=68,451.95..68,451.96 rows=1 width=192) (actual time=717.658..717.659 rows=1 loops=1)

2.          

Initplan (for Limit)

3. 0.310 4.595 ↑ 1.0 1 1

Aggregate (cost=9,383.20..9,383.21 rows=1 width=32) (actual time=4.594..4.595 rows=1 loops=1)

4. 0.203 4.285 ↑ 128.3 1,119 1

Nested Loop (cost=0.70..9,024.34 rows=143,540 width=6) (actual time=1.325..4.285 rows=1,119 loops=1)

5. 1.089 2.578 ↑ 2.5 188 1

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

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

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

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

Index Scan using doc_id_idx on t_tran tr (cost=0.42..15.10 rows=416 width=14) (actual time=0.004..0.008 rows=6 loops=188)

  • Index Cond: (doc_id = d.doc_id)
  • Filter: (NOT deleted)
10. 0.328 690.852 ↑ 1.0 1 1

Aggregate (cost=48,452.11..48,452.12 rows=1 width=32) (actual time=690.852..690.852 rows=1 loops=1)

11.          

Initplan (for Aggregate)

12. 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
13. 0.003 0.003 ↑ 1.0 1 1

Seq Scan on t_doc_type dt1 (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
14. 116.230 690.516 ↑ 76.6 1,119 1

Hash Semi Join (cost=18,320.58..48,235.68 rows=85,730 width=6) (actual time=572.754..690.516 rows=1,119 loops=1)

  • Hash Cond: ((tr_1.barcode)::text = (tr1.barcode)::text)
15. 0.385 1.811 ↑ 171.2 1,119 1

Nested Loop (cost=0.42..14,989.24 rows=191,593 width=19) (actual time=0.027..1.811 rows=1,119 loops=1)

16. 0.486 0.486 ↑ 3.3 188 1

Seq Scan on t_doc d_1 (cost=0.00..56.16 rows=618 width=8) (actual time=0.017..0.486 rows=188 loops=1)

  • Filter: ((NOT deleted) AND (doc_type_id = $2))
  • Rows Removed by Filter: 1754
17. 0.940 0.940 ↑ 69.3 6 188

Index Scan using doc_id_idx on t_tran tr_1 (cost=0.42..20.00 rows=416 width=27) (actual time=0.003..0.005 rows=6 loops=188)

  • Index Cond: (doc_id = d_1.doc_id)
  • Filter: (NOT deleted)
18. 187.772 572.475 ↓ 3.0 582,889 1

Hash (cost=14,989.24..14,989.24 rows=191,593 width=13) (actual time=572.475..572.475 rows=582,889 loops=1)

  • Buckets: 32768 (originally 32768) Batches: 32 (originally 16) Memory Usage: 1092kB
19. 102.345 384.703 ↓ 3.0 582,889 1

Nested Loop (cost=0.42..14,989.24 rows=191,593 width=13) (actual time=0.020..384.703 rows=582,889 loops=1)

20. 1.450 1.450 ↓ 2.8 1,734 1

Seq Scan on t_doc d1 (cost=0.00..56.16 rows=618 width=8) (actual time=0.011..1.450 rows=1,734 loops=1)

  • Filter: ((NOT deleted) AND (doc_type_id = $3))
  • Rows Removed by Filter: 208
21. 280.908 280.908 ↑ 1.2 336 1,734

Index Scan using doc_id_idx on t_tran tr1 (cost=0.42..20.00 rows=416 width=21) (actual time=0.006..0.162 rows=336 loops=1,734)

  • Index Cond: (doc_id = d1.doc_id)
  • Filter: (NOT deleted)
22. 0.017 1.934 ↑ 1.0 1 1

Aggregate (cost=9,383.20..9,383.21 rows=1 width=32) (actual time=1.933..1.934 rows=1 loops=1)

23. 0.019 1.917 ↑ 7,177.0 20 1

Nested Loop (cost=0.70..9,024.34 rows=143,540 width=6) (actual time=0.772..1.917 rows=20 loops=1)

24. 0.796 1.798 ↑ 23.1 20 1

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

  • Join Filter: (dt_2.doc_type_id = d_2.doc_type_id)
  • Rows Removed by Join Filter: 1922
25. 1.002 1.002 ↓ 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.041..1.002 rows=1,942 loops=1)

  • Filter: (NOT deleted)
26. 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)

27. 0.012 0.012 ↑ 1.0 1 1

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

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

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

  • Index Cond: (doc_id = d_2.doc_id)
  • Filter: (NOT deleted)
29. 0.354 1.471 ↑ 1.0 1 1

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

30. 1.117 1.117 ↓ 1.0 2,908 1

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

  • Filter: (NOT deleted)
31. 0.030 1.181 ↑ 1.0 1 1

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

32. 0.351 1.151 ↑ 2.5 188 1

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

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

  • Filter: (NOT deleted)
34. 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
35. 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.005..0.005 rows=1 loops=1)

  • Filter: ((brief)::text = 'OUTDOC'::text)
  • Rows Removed by Filter: 3
36. 0.314 2.043 ↑ 1.0 1 1

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

37. 0.760 1.729 ↓ 3.7 1,734 1

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

  • Hash Cond: (d_4.doc_type_id = dt_4.doc_type_id)
38. 0.960 0.960 ↓ 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.009..0.960 rows=1,942 loops=1)

  • Filter: (NOT deleted)
39. 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
40. 0.007 0.007 ↑ 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.007 rows=1 loops=1)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
41. 0.007 1.111 ↑ 1.0 1 1

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

42. 0.399 1.104 ↑ 23.1 20 1

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

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

  • Filter: (NOT deleted)
44. 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
45. 0.005 0.005 ↑ 1.0 1 1

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

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

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

47. 0.008 0.064 ↓ 35.0 35 1

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

  • Join Filter: (ttt.task_type_id = tt.type_id)
48. 0.011 0.011 ↑ 1.0 1 1

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

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

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

  • Filter: (NOT deleted)
50. 0.004 0.072 ↑ 1.0 1 1

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

51. 0.036 0.068 ↑ 1.2 12 1

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

  • Hash Cond: (c.content_type_id = ct.content_type_id)
52. 0.022 0.022 ↑ 1.4 33 1

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

53. 0.003 0.010 ↑ 1.0 1 1

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

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

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

  • Filter: ((brief)::text = 'NEWS'::text)
  • Rows Removed by Filter: 4
55. 0.004 0.052 ↑ 1.0 1 1

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

56. 0.016 0.048 ↑ 7.5 2 1

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

  • Hash Cond: (c_1.content_type_id = ct_1.content_type_id)
57. 0.026 0.026 ↑ 1.4 33 1

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

58. 0.002 0.006 ↑ 1.0 1 1

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

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

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

  • Filter: ((brief)::text = 'ARTICLES'::text)
  • Rows Removed by Filter: 4
60. 0.006 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)

61. 0.018 0.035 ↓ 1.1 17 1

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

  • Hash Cond: (c_2.content_type_id = ct_2.content_type_id)
62. 0.011 0.011 ↑ 1.4 33 1

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

63. 0.002 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
64. 0.004 0.004 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'INSTRUCTIONAL_VIDEOS'::text)
  • Rows Removed by Filter: 4
65. 0.005 2.219 ↑ 1.0 1 1

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

66. 0.537 2.214 ↑ 40.6 8 1

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

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

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

  • Filter: (NOT deleted)
68. 0.001 0.011 ↑ 1.0 1 1

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

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

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

  • Filter: ((brief)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 4
70. 0.023 1.936 ↑ 1.0 1 1

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

71. 0.510 1.913 ↑ 54.2 6 1

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

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
74. 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
75. 0.418 8.602 ↑ 1.0 1 1

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

76. 1.363 8.184 ↓ 3.7 1,734 1

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

77. 0.728 1.619 ↓ 3.7 1,734 1

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

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

  • Filter: (NOT deleted)
79. 0.005 0.011 ↑ 1.0 1 1

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

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

Seq Scan on t_doc_type dt_6 (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
81. 5.202 5.202 ↑ 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.003..0.003 rows=1 loops=1,734)

  • Index Cond: (subject_id = d_6.partner_id)
  • Filter: (NOT deleted)
82. 0.223 1.439 ↑ 1.0 1 1

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

83. 0.259 1.216 ↓ 2.6 1,580 1

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

84. 0.014 0.014 ↑ 1.0 1 1

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

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

  • Index Cond: (cat_id = c_3.cat_id)
  • Heap Fetches: 1580
86. 717.656 717.656 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=192) (actual time=717.656..717.656 rows=1 loops=1)

Planning time : 3.178 ms
Execution time : 718.320 ms