explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VrOG

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

Limit (cost=80,600.70..80,600.71 rows=1 width=168) (actual time=518.850..518.852 rows=1 loops=1)

2.          

Initplan (for Limit)

3. 0.220 1.570 ↑ 1.0 1 1

Aggregate (cost=15,469.28..15,469.29 rows=1 width=32) (actual time=1.570..1.570 rows=1 loops=1)

4.          

Initplan (for Aggregate)

5. 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
6. 0.187 1.346 ↑ 171.2 1,119 1

Nested Loop (cost=0.42..14,989.24 rows=191,593 width=6) (actual time=0.025..1.346 rows=1,119 loops=1)

7. 0.407 0.407 ↑ 3.3 188 1

Seq Scan on t_doc d (cost=0.00..56.16 rows=618 width=8) (actual time=0.015..0.407 rows=188 loops=1)

  • Filter: ((NOT deleted) AND (doc_type_id = $0))
  • Rows Removed by Filter: 1,754
8. 0.752 0.752 ↑ 69.3 6 188

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

  • Index Cond: (doc_id = d.doc_id)
  • Filter: (NOT deleted)
9. 0.260 505.519 ↑ 1.0 1 1

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

10.          

Initplan (for Aggregate)

11. 0.003 0.003 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
12. 0.002 0.002 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'OUTDOC'::text)
  • Rows Removed by Filter: 3
13. 202.609 505.254 ↑ 75.9 1,129 1

Hash Semi Join (cost=18,320.58..48,235.68 rows=85,730 width=6) (actual time=25.180..505.254 rows=1,129 loops=1)

  • Hash Cond: ((tr_1.barcode)::text = (tr1.barcode)::text)
14. 81.316 300.665 ↓ 3.0 582,889 1

Nested Loop (cost=0.42..14,989.24 rows=191,593 width=19) (actual time=0.012..300.665 rows=582,889 loops=1)

15. 0.865 0.865 ↓ 2.8 1,734 1

Seq Scan on t_doc d_1 (cost=0.00..56.16 rows=618 width=8) (actual time=0.007..0.865 rows=1,734 loops=1)

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

Index Scan using doc_id_idx on t_tran tr_1 (cost=0.42..20.00 rows=416 width=27) (actual time=0.005..0.126 rows=336 loops=1,734)

  • Index Cond: (doc_id = d_1.doc_id)
  • Filter: (NOT deleted)
17. 0.483 1.980 ↑ 171.2 1,119 1

Hash (cost=14,989.24..14,989.24 rows=191,593 width=13) (actual time=1.980..1.980 rows=1,119 loops=1)

  • Buckets: 32,768 Batches: 16 Memory Usage: 267kB
18. 0.383 1.497 ↑ 171.2 1,119 1

Nested Loop (cost=0.42..14,989.24 rows=191,593 width=13) (actual time=0.010..1.497 rows=1,119 loops=1)

19. 0.362 0.362 ↑ 3.3 188 1

Seq Scan on t_doc d1 (cost=0.00..56.16 rows=618 width=8) (actual time=0.006..0.362 rows=188 loops=1)

  • Filter: ((NOT deleted) AND (doc_type_id = $4))
  • Rows Removed by Filter: 1,754
20. 0.752 0.752 ↑ 69.3 6 188

Index Scan using doc_id_idx on t_tran tr1 (cost=0.42..20.00 rows=416 width=21) (actual time=0.002..0.004 rows=6 loops=188)

  • Index Cond: (doc_id = d1.doc_id)
  • Filter: (NOT deleted)
21. 0.004 0.548 ↑ 1.0 1 1

Aggregate (cost=15,469.28..15,469.29 rows=1 width=32) (actual time=0.548..0.548 rows=1 loops=1)

22.          

Initplan (for Aggregate)

23. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_2 (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
24. 0.014 0.537 ↑ 9,579.6 20 1

Nested Loop (cost=0.42..14,989.24 rows=191,593 width=6) (actual time=0.061..0.537 rows=20 loops=1)

25. 0.423 0.423 ↑ 30.9 20 1

Seq Scan on t_doc d_2 (cost=0.00..56.16 rows=618 width=8) (actual time=0.035..0.423 rows=20 loops=1)

  • Filter: ((NOT deleted) AND (doc_type_id = $8))
  • Rows Removed by Filter: 1,922
26. 0.100 0.100 ↑ 416.0 1 20

Index Scan using doc_id_idx on t_tran tr_2 (cost=0.42..20.00 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)
27. 0.283 1.100 ↑ 1.0 1 1

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

28. 0.817 0.817 ↓ 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.817 rows=2,908 loops=1)

  • Filter: (NOT deleted)
29. 0.018 0.652 ↑ 1.0 1 1

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

30. 0.207 0.634 ↑ 2.5 188 1

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

  • Hash Cond: (d_3.doc_type_id = dt_3.doc_type_id)
31. 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)
32. 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: 1,024 Batches: 1 Memory Usage: 9kB
33. 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.004..0.004 rows=1 loops=1)

  • Filter: ((brief)::text = 'OUTDOC'::text)
  • Rows Removed by Filter: 3
34. 0.144 0.949 ↑ 1.0 1 1

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

35. 0.372 0.805 ↓ 3.7 1,734 1

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

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

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
38. 0.003 0.003 ↑ 1.0 1 1

Seq Scan on t_doc_type dt_4 (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
39. 0.004 0.689 ↑ 1.0 1 1

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

40. 0.177 0.685 ↑ 23.1 20 1

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

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

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
43. 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.003..0.003 rows=1 loops=1)

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

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

45. 0.007 0.025 ↓ 35.0 35 1

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

  • Join Filter: (ttt.task_type_id = tt.type_id)
46. 0.007 0.007 ↑ 1.0 1 1

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

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

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

  • Filter: (NOT deleted)
48. 0.003 1.292 ↑ 1.0 1 1

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

49. 0.320 1.289 ↑ 40.6 8 1

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

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

  • Filter: (NOT deleted)
51. 0.002 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: 1,024 Batches: 1 Memory Usage: 9kB
52. 0.006 0.006 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 4
53. 0.003 0.988 ↑ 1.0 1 1

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

54. 0.323 0.985 ↑ 54.2 6 1

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

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

  • Filter: (NOT deleted)
56. 0.002 0.026 ↑ 1.0 1 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
57. 0.024 0.024 ↑ 1.0 1 1

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

  • Filter: ((brief)::text = 'SELLER'::text)
  • Rows Removed by Filter: 4
58. 0.234 4.565 ↑ 1.0 1 1

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

59. 0.000 4.331 ↓ 3.7 1,734 1

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

60. 0.419 0.901 ↓ 3.7 1,734 1

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

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

  • Filter: (NOT deleted)
62. 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: 1,024 Batches: 1 Memory Usage: 9kB
63. 0.004 0.004 ↑ 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.004 rows=1 loops=1)

  • Filter: ((brief)::text = 'INDOC'::text)
  • Rows Removed by Filter: 3
64. 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)
65. 0.127 0.927 ↑ 1.0 1 1

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

66. 0.170 0.800 ↓ 2.6 1,580 1

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

67. 0.011 0.011 ↑ 1.0 1 1

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

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

  • Index Cond: (cat_id = c.cat_id)
  • Heap Fetches: 1,580
69. 518.850 518.850 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=168) (actual time=518.849..518.850 rows=1 loops=1)

Planning time : 2.449 ms
Execution time : 519.270 ms