explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GZI

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 15.544 ↑ 1.0 1 1

Result (cost=116,623.44..116,623.45 rows=1 width=48) (actual time=15.544..15.544 rows=1 loops=1)

2.          

CTE d

3. 0.226 15.503 ↓ 0.0 0 1

Nested Loop (cost=1.12..9,445.17 rows=95 width=8) (actual time=15.503..15.503 rows=0 loops=1)

4. 0.697 0.697 ↓ 7.5 972 1

Index Only Scan using document_status_user_id_document_id_idx on document_status ds (cost=0.56..211.62 rows=129 width=8) (actual time=0.016..0.697 rows=972 loops=1)

  • Index Cond: (user_id = 5851289)
  • Heap Fetches: 490
5. 5.832 14.580 ↓ 0.0 0 972

Index Only Scan using "idx$$_8cdf0001" on document d (cost=0.57..71.57 rows=1 width=8) (actual time=0.015..0.015 rows=0 loops=972)

  • Index Cond: ((deleted = 0) AND (id = ds.document_id))
  • Filter: ((SubPlan 2) OR (alternatives: SubPlan 3 or hashed SubPlan 4))
  • Rows Removed by Filter: 1
  • Heap Fetches: 1083
6.          

SubPlan (forIndex Only Scan)

7. 0.000 5.832 ↓ 0.0 0 972

Result (cost=3.54..49.33 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=972)

  • One-Time Filter: (NOT $1)
8.          

Initplan (forResult)

9. 3.888 3.888 ↓ 0.0 0 972

Index Only Scan using doc_n_did_c_n_nbl_del_oid_idx on document_n (cost=0.57..8.81 rows=12 width=0) (actual time=0.004..0.004 rows=0 loops=972)

  • Index Cond: ((document_id = d.id) AND (category = 6))
  • Heap Fetches: 0
10. 0.000 1.944 ↓ 0.0 0 972

Nested Loop Anti Join (cost=3.54..49.33 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=972)

  • Join Filter: (rc.parent_id = r.id)
11. 0.000 1.944 ↓ 0.0 0 972

Nested Loop Anti Join (cost=1.71..39.47 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=972)

12. 0.000 1.944 ↓ 0.0 0 972

Nested Loop (cost=1.14..29.25 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=972)

  • Join Filter: (r.id = rt.resolution_id)
13. 1.944 1.944 ↓ 0.0 0 972

Index Only Scan using "idx$$_6155000f" on resolution_to rt (cost=0.57..8.69 rows=6 width=8) (actual time=0.002..0.002 rows=0 loops=972)

  • Index Cond: ((acting_disable = 1) AND (user_id = 5851289))
  • Heap Fetches: 0
14. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.57..20.12 rows=5 width=8) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Index Scan using resolution_document_id_author_on_not_project_idx on resolution r (cost=0.57..20.09 rows=5 width=8) (never executed)

  • Index Cond: (document_id = d.id)
16. 0.000 0.000 ↓ 0.0 0

Index Only Scan using re_res_doc_auth_isintrm_idx on r_execution rec (cost=0.57..5.39 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = r.id) AND (document_id = d.id) AND (author = 5851289) AND (is_interim = 0))
  • Heap Fetches: 0
17. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.57..8.60 rows=1 width=8) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Index Scan using resolution_document_id_author_on_not_project_idx on resolution rc (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Index Cond: ((document_id = d.id) AND (author = 5851289))
19. 0.000 2.916 ↓ 0.0 0 972

Nested Loop (cost=1.13..17.18 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=972)

20. 2.916 2.916 ↓ 0.0 0 972

Index Scan using dcv_docid_dcid_version_idx on document_c_version dcv (cost=0.56..8.58 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=972)

  • Index Cond: (document_id = d.id)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using dcvt_dcvid_userid_status_idx on document_c_version_to dcvt (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Index Cond: ((dcv_id = dcv.id) AND (user_id = 5851289))
  • Filter: ((status = ANY ('{1,2}'::bigint[])) AND (acting_disable = 1))
22. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.00..186.28 rows=1 width=8) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx$$_6d760001" on document_c_version_to dcvt_1 (cost=0.57..177.82 rows=1 width=8) (never executed)

  • Index Cond: ((user_id = 5851289) AND (status = ANY ('{1,2}'::bigint[])))
  • Filter: (acting_disable = 1)
24. 0.000 0.000 ↓ 0.0 0

Index Scan using document_c_version_pk on document_c_version dcv_1 (cost=0.44..8.46 rows=1 width=16) (never executed)

  • Index Cond: (id = dcvt_1.dcv_id)
25.          

Initplan (forResult)

26. 0.008 15.514 ↑ 1.0 1 1

Aggregate (cost=104,104.80..104,104.81 rows=1 width=8) (actual time=15.514..15.514 rows=1 loops=1)

27. 0.001 15.506 ↓ 0.0 0 1

Nested Loop Semi Join (cost=3.28..104,104.80 rows=1 width=8) (actual time=15.506..15.506 rows=0 loops=1)

28. 0.000 15.505 ↓ 0.0 0 1

Nested Loop (cost=2.71..104,072.19 rows=1 width=16) (actual time=15.505..15.505 rows=0 loops=1)

29. 0.000 15.505 ↓ 0.0 0 1

HashAggregate (cost=2.14..3.09 rows=95 width=8) (actual time=15.505..15.505 rows=0 loops=1)

  • Group Key: d_1.id
30. 15.505 15.505 ↓ 0.0 0 1

CTE Scan on d d_1 (cost=0.00..1.90 rows=95 width=8) (actual time=15.505..15.505 rows=0 loops=1)

31. 0.000 0.000 ↓ 0.0 0

Index Scan using res_docid_author_test_3_idx on resolution r_a (cost=0.57..1,095.45 rows=1 width=16) (never executed)

  • Index Cond: ((document_id = d_1.id) AND (author = 5851289))
  • Filter: (SubPlan 9)
32.          

SubPlan (forIndex Scan)

33. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=872.52..1,086.86 rows=1 width=0) (never executed)

34.          

CTE r

35. 0.000 0.000 ↓ 0.0 0

Recursive Union (cost=0.57..870.81 rows=11 width=58) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Index Scan using res_parent_id_doc_id_idx on resolution r2 (cost=0.57..8.59 rows=1 width=58) (never executed)

  • Index Cond: ((parent_id = r_a.id) AND (document_id = r_a.document_id))
37. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..86.20 rows=1 width=58) (never executed)

38. 0.000 0.000 ↓ 0.0 0

WorkTable Scan on r r_1 (cost=0.00..0.20 rows=10 width=16) (never executed)

39. 0.000 0.000 ↓ 0.0 0

Index Scan using res_parent_id_doc_id_idx on resolution r2_1 (cost=0.57..8.59 rows=1 width=58) (never executed)

  • Index Cond: ((parent_id = r_1.id) AND (document_id = r_1.document_id))
40. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=1.14..207.45 rows=1 width=8) (never executed)

41. 0.000 0.000 ↓ 0.0 0

CTE Scan on r r_2 (cost=0.00..179.87 rows=1 width=32) (never executed)

  • Filter: ((is_project = 0) AND ((is_forward = 0) OR (NOT (alternatives: SubPlan 7 or hashed SubPlan 8))))
42.          

SubPlan (forCTE Scan)

43. 0.000 0.000 ↓ 0.0 0

Index Scan using ro_resolution_id_idx on resolution_order ro (cost=0.57..16.33 rows=1 width=0) (never executed)

  • Index Cond: (resolution_id = r_2.id)
  • Filter: (text ~~ 'Создано автоматически%'::text)
44. 0.000 0.000 ↓ 0.0 0

Seq Scan on resolution_order ro_1 (cost=0.00..6,947,416.12 rows=228,510 width=8) (never executed)

  • Filter: (text ~~ 'Создано автоматически%'::text)
45. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..27.57 rows=4 width=24) (never executed)

46. 0.000 0.000 ↓ 0.0 0

Index Scan using res_doc_id_test_1 on resolution r2_2 (cost=0.57..23.00 rows=3 width=32) (never executed)

  • Index Cond: (document_id = r_2.document_id)
  • Filter: ((rdate > r_2.rdate) OR (cdate > r_2.cdate))
47. 0.000 0.000 ↓ 0.0 0

Index Only Scan using resolution_id_idx on resolution_to rt2 (cost=0.57..1.46 rows=6 width=8) (never executed)

  • Index Cond: (resolution_id = r2_2.id)
  • Heap Fetches: 0
48. 0.000 0.000 ↓ 0.0 0

Index Scan using rt_resid_usrid_idx on resolution_to rt_1 (cost=0.57..8.60 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = r_2.id) AND (user_id = 5851289))
  • Filter: (((acting_disable = 1) AND (acting_send_user_id IS NOT NULL)) OR (acting_disable = 0))
49. 0.000 0.000 ↓ 0.0 0

Index Scan using resolution_id_idx on resolution_to (cost=0.57..16.59 rows=1 width=8) (never executed)

  • Index Cond: (resolution_id = r_a.id)
  • Filter: (dback = 1)
50. 0.000 0.001 ↑ 1.0 1 1

Aggregate (cost=857.90..857.91 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1)

51. 0.000 0.001 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1.14..857.72 rows=75 width=0) (actual time=0.001..0.001 rows=0 loops=1)

52. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on d d_2 (cost=0.00..1.90 rows=95 width=8) (actual time=0.001..0.001 rows=0 loops=1)

53. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..9.00 rows=1 width=8) (never executed)

54. 0.000 0.000 ↓ 0.0 0

Index Only Scan using res_docid_id_csdr on resolution rp (cost=0.57..5.81 rows=1 width=16) (never executed)

  • Index Cond: ((document_id = d_2.id) AND (is_csdr = 1) AND (is_csdr_sent = 1))
  • Heap Fetches: 0
55. 0.000 0.000 ↓ 0.0 0

Index Only Scan using rt_resid_usrid_idx on resolution_to rtp (cost=0.57..3.18 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = rp.id) AND (user_id = 5851289))
  • Heap Fetches: 0
56. 0.002 0.016 ↑ 1.0 1 1

Aggregate (cost=448.02..448.03 rows=1 width=8) (actual time=0.016..0.016 rows=1 loops=1)

57. 0.000 0.014 ↓ 0.0 0 1

Nested Loop (cost=1.15..448.02 rows=1 width=0) (actual time=0.014..0.014 rows=0 loops=1)

58. 0.014 0.014 ↓ 0.0 0 1

Nested Loop Anti Join (cost=0.57..443.37 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=1)

59. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on d d_3 (cost=0.00..1.90 rows=95 width=8) (actual time=0.000..0.000 rows=0 loops=1)

60. 0.000 0.000 ↓ 0.0 0

Index Only Scan using dr_uid_did on document_read dr (cost=0.57..4.64 rows=1 width=8) (never executed)

  • Index Cond: ((user_id = 5851289) AND (document_id = d_3.id))
  • Heap Fetches: 0
61. 0.000 0.000 ↓ 0.0 0

Index Only Scan using du_user_id_did_idx on document_user du (cost=0.57..4.64 rows=1 width=8) (never executed)

  • Index Cond: ((user_id = 5851289) AND (document_id = d_3.id))
  • Heap Fetches: 0
62. 0.000 0.005 ↑ 1.0 1 1

Aggregate (cost=18.80..18.81 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)

63. 0.001 0.005 ↓ 0.0 0 1

Hash Semi Join (cost=3.38..18.79 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=1)

  • Hash Cond: (concurrent_csdr_status.document_id = d_4.id)
64. 0.004 0.004 ↓ 0.0 0 1

Index Scan using cc_status_user_id_idx on concurrent_csdr_status (cost=0.29..15.70 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: (user_id = 5851289)
  • Filter: (status = ANY ('{2,3}'::integer[]))
65. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.90..1.90 rows=95 width=8) (never executed)

66. 0.000 0.000 ↓ 0.0 0

CTE Scan on d d_4 (cost=0.00..1.90 rows=95 width=8) (never executed)

67. 0.001 0.002 ↑ 1.0 1 1

Aggregate (cost=865.71..865.72 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1)

68. 0.000 0.001 ↓ 0.0 0 1

Nested Loop Anti Join (cost=4.42..865.71 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

69. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=3.28..832.89 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=1)

70. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=2.71..820.32 rows=4 width=24) (actual time=0.001..0.001 rows=0 loops=1)

71. 0.001 0.001 ↓ 0.0 0 1

HashAggregate (cost=2.14..3.09 rows=95 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Group Key: d_5.id
72. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on d d_5 (cost=0.00..1.90 rows=95 width=8) (actual time=0.000..0.000 rows=0 loops=1)

73. 0.000 0.000 ↓ 0.0 0

Index Scan using res_doc_id_test_1 on resolution rp_1 (cost=0.57..8.59 rows=1 width=24) (never executed)

  • Index Cond: ((document_id = d_5.id) AND (is_csdr_sent = 1))
  • Filter: (is_csdr = 1)
74. 0.000 0.000 ↓ 0.0 0

Index Only Scan using rt_resid_usrid_idx on resolution_to rtp_1 (cost=0.57..3.13 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = rp_1.id) AND (user_id = 5851289))
  • Heap Fetches: 0
75. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..16.98 rows=1 width=28) (never executed)

76. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx$$_760b0009" on resolution rp2 (cost=0.57..14.73 rows=1 width=36) (never executed)

  • Index Cond: (document_id = rp_1.document_id)
  • Filter: ((((is_project = 0) AND ((is_csdr = 0) OR (is_csdr_sent = 1))) OR ((is_csdr = 1) AND (is_csdr_sent = 1))) AND (((is_project = 0) AND ((is_csdr = 0) OR (is_csdr_sent = 1)) AND (cdate > rp_1.cdate)) OR ((is_csdr = 1) AND (is_csdr_sent = 1) AND (cdate < rp_1.cdate))))
77. 0.000 0.000 ↓ 0.0 0

Index Only Scan using rt_resid_usrid_idx on resolution_to rtp2 (cost=0.57..2.24 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = rp2.id) AND (user_id = 5851289))
  • Heap Fetches: 0
78. 0.002 0.003 ↑ 1.0 1 1

Aggregate (cost=882.97..882.98 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=1)

79. 0.000 0.001 ↓ 0.0 0 1

Nested Loop Anti Join (cost=5.57..882.97 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

80. 0.001 0.001 ↓ 0.0 0 1

Nested Loop Semi Join (cost=4.42..853.36 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=1)

81. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=3.28..833.86 rows=1 width=24) (actual time=0.000..0.000 rows=0 loops=1)

82. 0.000 0.000 ↓ 0.0 0 1

Nested Loop (cost=2.71..820.32 rows=4 width=32) (actual time=0.000..0.000 rows=0 loops=1)

83. 0.000 0.000 ↓ 0.0 0 1

HashAggregate (cost=2.14..3.09 rows=95 width=8) (actual time=0.000..0.000 rows=0 loops=1)

  • Group Key: d_6.id
84. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on d d_6 (cost=0.00..1.90 rows=95 width=8) (actual time=0.000..0.000 rows=0 loops=1)

85. 0.000 0.000 ↓ 0.0 0

Index Scan using res_doc_id_test_1 on resolution rp_2 (cost=0.57..8.59 rows=1 width=24) (never executed)

  • Index Cond: ((document_id = d_6.id) AND (is_csdr_sent = 1))
  • Filter: (is_csdr = 1)
86. 0.000 0.000 ↓ 0.0 0

Index Only Scan using rt_resid_usrid_idx on resolution_to rtp_2 (cost=0.57..3.37 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = rp_2.id) AND (user_id = 5851289))
  • Heap Fetches: 0
87. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..10.31 rows=1 width=16) (never executed)

88. 0.000 0.000 ↓ 0.0 0

Index Scan using res_doc_id_test_1 on resolution rp3 (cost=0.57..6.93 rows=1 width=24) (never executed)

  • Index Cond: ((document_id = rp_2.document_id) AND (is_csdr_sent = 1))
  • Filter: ((is_csdr = 1) AND (cdate < rp_2.cdate))
89. 0.000 0.000 ↓ 0.0 0

Index Only Scan using rt_resid_usrid_idx on resolution_to rtp3 (cost=0.57..3.37 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = rp3.id) AND (user_id = 5851289))
  • Heap Fetches: 0
90. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..15.37 rows=1 width=16) (never executed)

91. 0.000 0.000 ↓ 0.0 0

Index Scan using r_isproject_test1_r_idx on resolution rp2_1 (cost=0.57..9.33 rows=2 width=24) (never executed)

  • Index Cond: ((document_id = rp_2.document_id) AND (is_project = 0) AND (cdate > rp_2.cdate))
  • Filter: ((is_csdr = 0) OR (is_csdr_sent = 1))
92. 0.000 0.000 ↓ 0.0 0

Index Only Scan using rt_resid_usrid_idx on resolution_to rtp2_1 (cost=0.57..3.01 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_id = rp2_1.id) AND (user_id = 5851289))
  • Heap Fetches: 0