explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lRXV

Settings
# exclusive inclusive rows x rows loops node
1. 0.031 5,353,860.371 ↓ 0.0 0 1

Sort (cost=2,659,715.68..2,659,715.68 rows=1 width=78) (actual time=5,353,860.371..5,353,860.371 rows=0 loops=1)

  • Sort Key: r.special_control DESC, ur.name, ((SubPlan 12))
  • Sort Method: quicksort Memory: 25kB
2. 0.002 5,353,860.340 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.82..2,659,715.67 rows=1 width=78) (actual time=5,353,860.340..5,353,860.340 rows=0 loops=1)

3. 0.001 5,353,860.338 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.39..2,659,555.79 rows=1 width=69) (actual time=5,353,860.338..5,353,860.338 rows=0 loops=1)

4. 0.002 5,353,860.337 ↓ 0.0 0 1

Nested Loop (cost=3.82..2,659,552.21 rows=1 width=69) (actual time=5,353,860.337..5,353,860.337 rows=0 loops=1)

5. 0.138 5,353,860.335 ↓ 0.0 0 1

Nested Loop (cost=3.40..2,659,550.00 rows=1 width=63) (actual time=5,353,860.335..5,353,860.335 rows=0 loops=1)

6. 140.685 5,353,859.777 ↓ 70.0 70 1

Nested Loop (cost=2.97..2,659,547.79 rows=1 width=71) (actual time=531,182.280..5,353,859.777 rows=70 loops=1)

7. 3,620.535 4,622,321.342 ↓ 216.7 136,074 1

Nested Loop (cost=2.41..2,640,197.57 rows=628 width=47) (actual time=16.776..4,622,321.342 rows=136,074 loops=1)

8. 1,480.799 592,564.397 ↓ 325.9 4,627,743 1

Nested Loop (cost=1.83..752,262.06 rows=14,201 width=39) (actual time=4.455..592,564.397 rows=4,627,743 loops=1)

9. 320.288 22,457.729 ↓ 48.9 545,183 1

Nested Loop (cost=1.26..402,216.24 rows=11,146 width=29) (actual time=2.194..22,457.729 rows=545,183 loops=1)

10. 5,781.111 5,781.111 ↓ 48.2 545,211 1

Index Only Scan using document_n588_test1 on document_n dn (cost=0.70..347,443.94 rows=11,321 width=21) (actual time=0.391..5,781.111 rows=545,211 loops=1)

  • Index Cond: ((org_id = 29) AND (n = 0))
  • Filter: ((category <> 6) AND (CASE WHEN (num IS NULL) THEN 0 ELSE 1 END = 1) AND (((num)::text ~~ '01-02-06%'::text) OR ((num)::text ~~ '01-03-06%'::text) OR ((num)::text ~~ '01-04-06%'::text) OR ((num)::text ~~ '05-07%'::text) OR ((num)::text ~~ '05-08%'::text) OR ((num)::text ~~ '05-09%'::text) OR ((num)::text ~~ '05-10%'::text) OR ((num)::text ~~ '05-11%'::text) OR ((num)::text ~~ '05-12%'::text) OR ((num)::text ~~ '05-13%'::text) OR ((num)::text ~~ '05-14%'::text) OR ((num)::text ~~ '05-15%'::text) OR ((num)::text ~~ '05-16%'::text) OR ((num)::text ~~ 'ВН-01-02-06%'::text) OR ((num)::text ~~ 'ВН-01-03-06%'::text) OR ((num)::text ~~ 'ВН-01-04-06%'::text) OR ((num)::text ~~ 'ВН-05-01%'::text) OR ((num)::text ~~ 'ВН-05-02%'::text) OR ((num)::text ~~ 'ВН-05-03%'::text) OR ((num)::text ~~ 'ВН-05-04%'::text) OR ((num)::text ~~ 'ВН-05-05%'::text) OR ((num)::text ~~ 'ВН-05-06%'::text) OR ((num)::text ~~ 'ВН-05-07%'::text) OR ((num)::text ~~ 'ВН-05-08%'::text) OR ((num)::text ~~ 'ВН-05-09%'::text) OR ((num)::text ~~ 'ВН-05-10%'::text) OR ((num)::text ~~ 'ВН-05-11%'::text) OR ((num)::text ~~ 'ВН-05-12%'::text) OR ((num)::text ~~ 'ВН-05-13%'::text) OR ((num)::text ~~ 'ВН-05-14%'::text) OR ((num)::text ~~ 'ВН-05-15%'::text) OR ((num)::text ~~ 'ВН-05-16%'::text) OR ((num)::text ~~ 'ВН-05-17%'::text) OR ((num)::text ~~ 'ВН-05-18%'::text) OR ((num)::text ~~ 'ВН-05-18и%'::text) OR ((num)::text ~~ 'ВН-05-19%'::text) OR ((num)::text ~~ 'ВН-05-20%'::text) OR ((num)::text ~~ 'ВН-05-21%'::text) OR ((num)::text ~~ 'ВН-05-22%'::text) OR ((num)::text ~~ 'ВОЗВРАТ%'::text) OR ((num)::text ~~ 'ВОЗВРАТ ВН%'::text) OR ((num)::text ~~ 'ДПиООС 01-02-06%'::text) OR ((num)::text ~~ 'ДПиООС 01-03-06%'::text) OR ((num)::text ~~ 'ДПиООС 01-04-06%'::text) OR ((num)::text ~~ 'ДПиООС 05-01%'::text) OR ((num)::text ~~ 'ДПиООС 05-02%'::text) OR ((num)::text ~~ 'ДПиООС 05-03%'::text) OR ((num)::text ~~ 'ДПиООС 05-04%'::text) OR ((num)::text ~~ 'ДПиООС 05-05%'::text) OR ((num)::text ~~ 'ДПиООС 05-06%'::text) OR ((num)::text ~~ 'ДПиООС 05-07%'::text) OR ((num)::text ~~ 'ДПиООС 05-08%'::text) OR ((num)::text ~~ 'ДПиООС 05-09%'::text) OR ((num)::text ~~ 'ДПиООС 05-10%'::text) OR ((num)::text ~~ 'ДПиООС 05-11%'::text) OR ((num)::text ~~ 'ДПиООС 05-12%'::text) OR ((num)::text ~~ 'ДПиООС 05-13%'::text) OR ((num)::text ~~ 'ДПиООС 05-14%'::text) OR ((num)::text ~~ 'ДПиООС 05-15%'::text) OR ((num)::text ~~ 'ДПиООС 05-16%'::text) OR ((num)::text ~~ 'ДПиООС 05-17%'::text) OR ((num)::text ~~ 'ДПиООС 05-18%'::text) OR ((num)::text ~~ 'ДПиООС 05-18и%'::text) OR ((num)::text ~~ 'ДПиООС 05-19%'::text) OR ((num)::text ~~ 'ДПиООС 05-20%'::text) OR ((num)::text ~~ 'ДПиООС 05-21%'::text) OR ((num)::text ~~ 'ДПиООС 05-22%'::text) OR ((num)::text ~~ 'ДПиООС 05-69%'::text) OR ((num)::text ~~ 'ДПиООС 07-67%'::text) OR ((num)::text ~~ 'ДПиООС 07-68%'::text) OR ((num)::text ~~ 'ДПиООС 07-69%'::text)))
  • Rows Removed by Filter: 637140
  • Heap Fetches: 28470
11. 16,356.330 16,356.330 ↑ 1.0 1 545,211

Index Only Scan using d_del_id_idx on document d (cost=0.57..4.83 rows=1 width=8) (actual time=0.029..0.030 rows=1 loops=545,211)

  • Index Cond: ((deleted = 0) AND (id = dn.document_id))
  • Heap Fetches: 106087
12. 566,831.437 568,625.869 ↓ 2.7 8 545,183

Index Scan using "idx$$_96770001" on resolution r (cost=0.57..31.38 rows=3 width=26) (actual time=0.175..1.043 rows=8 loops=545,183)

  • Index Cond: ((is_project = 0) AND (document_id = d.id) AND (is_forward = 0))
  • Filter: ((is_csdr = 0) AND ((has_vzamen IS NULL) OR (NOT (SubPlan 16))))
  • Rows Removed by Filter: 0
13.          

SubPlan (forIndex Scan)

14. 1,794.432 1,794.432 ↑ 1.0 1 28,038

Index Only Scan using res_vzamen_isproj_isfwd_idx on resolution rv (cost=0.57..8.59 rows=1 width=0) (actual time=0.064..0.064 rows=1 loops=28,038)

  • Index Cond: ((vzamen = r.id) AND (is_project = 0) AND (is_forward = 0))
  • Heap Fetches: 9113
15. 160,285.458 4,026,136.410 ↓ 0.0 0 4,627,743

Index Scan using "idx$$_61550012" on resolution_to rt (cost=0.57..132.93 rows=1 width=24) (actual time=0.824..0.870 rows=0 loops=4,627,743)

  • Index Cond: ((another_control = 1) AND (resolution_id = r.id))
  • Filter: ((primary_id IS NULL) AND ((SubPlan 25) > 0))
  • Rows Removed by Filter: 0
16.          

SubPlan (forIndex Scan)

17. 722.184 3,865,850.952 ↑ 1.0 1 722,184

Unique (cost=129.32..129.33 rows=1 width=12) (actual time=5.353..5.353 rows=1 loops=722,184)

18. 3,610.920 3,865,128.768 ↓ 2.0 2 722,184

Sort (cost=129.32..129.32 rows=1 width=12) (actual time=5.352..5.352 rows=2 loops=722,184)

  • Sort Key: (first_value(GREATEST(0, (date_part('day'::text, CASE WHEN ((ee_1.""TYPE"" = ANY ('{1,2,4}'::bigint[])) AND (ee_1.counters = 1)) THEN CASE WHEN (SubPlan 17) THEN (dn_2.rdate - (SubPlan 18)) ELSE CASE WHEN ((SubPlan 19) = 3) THEN ((SubPlan 20) - (SubPlan 21)) ELSE (CASE ee_1.""TYPE"" WHEN 1 THEN ee_1.cdate WHEN 2 THEN ee_1.exec_date WHEN 4 THEN ee_1.cdate ELSE NULL::timestamp without time zone END - (SubPlan 22)) END END ELSE CASE WHEN ((ee_1.""TYPE"" = 3) AND (NOT (SubPlan 23))) THEN (dn_2.rdate - (SubPlan 24)) ELSE NULL::interval END END))::integer)) OVER (?))
  • Sort Method: quicksort Memory: 25kB
19. 7,427.928 3,861,517.848 ↓ 2.0 2 722,184

WindowAgg (cost=1.57..129.31 rows=1 width=12) (actual time=5.121..5.347 rows=2 loops=722,184)

20. 2,002.148 2,670,636.432 ↓ 2.0 2 722,184

Nested Loop Left Join (cost=1.57..38.23 rows=1 width=50) (actual time=3.498..3.698 rows=2 loops=722,184)

  • Filter: ((dn_2.id IS NULL) OR ((dn_2.n = 0) AND (dn_2.org_id = r.r_org_id)))
  • Rows Removed by Filter: 1
21. 1,864.570 2,665,581.144 ↑ 1.0 2 722,184

Nested Loop Left Join (cost=1.00..28.13 rows=2 width=42) (actual time=3.493..3.691 rows=2 loops=722,184)

22. 2,495,867.904 2,495,867.904 ↑ 1.0 2 722,184

Index Scan Backward using ev_rtid_cd_idx on exec_event ee_1 (cost=0.57..11.21 rows=2 width=42) (actual time=3.325..3.456 rows=2 loops=722,184)

  • Index Cond: (resolution_to_id = rt.id)
23. 167,848.670 167,848.670 ↓ 0.0 0 1,525,897

Index Scan using fk_autoidx_1 on exec_event_d eed_1 (cost=0.43..8.45 rows=1 width=16) (actual time=0.110..0.110 rows=0 loops=1,525,897)

  • Index Cond: (exec_event_id = ee_1.id)
24. 3,053.140 3,053.140 ↓ 0.0 0 1,526,570

Index Scan using dn_doc_id_idx on document_n dn_2 (cost=0.57..4.12 rows=62 width=40) (actual time=0.002..0.002 rows=0 loops=1,526,570)

  • Index Cond: (document_id = eed_1.document_id)
25.          

SubPlan (forWindowAgg)

26. 2,433.441 105,640.971 ↓ 0.0 0 1,487,901

Nested Loop (cost=1.14..17.19 rows=1 width=0) (actual time=0.071..0.071 rows=0 loops=1,487,901)

27. 56,540.238 56,540.238 ↑ 1.0 1 1,487,901

Index Scan using rt_primary_id_idx on resolution_to rti_1 (cost=0.57..8.59 rows=1 width=8) (actual time=0.036..0.038 rows=1 loops=1,487,901)

  • Index Cond: (COALESCE(primary_id, id) = ee_1.resolution_to_id)
28. 46,667.292 46,667.292 ↓ 0.0 0 1,666,689

Index Scan using sys_c0014877 on resolution ri_1 (cost=0.57..8.59 rows=1 width=8) (actual time=0.028..0.028 rows=0 loops=1,666,689)

  • Index Cond: (id = rti_1.resolution_id)
  • Filter: (document_id = dn_2.document_id)
  • Rows Removed by Filter: 1
29. 22.157 25,258.980 ↑ 1.0 1 22,157

Unique (cost=8.61..8.62 rows=1 width=16) (actual time=1.140..1.140 rows=1 loops=22,157)

30. 66.471 25,236.823 ↓ 4.0 4 22,157

Sort (cost=8.61..8.62 rows=1 width=16) (actual time=1.139..1.139 rows=4 loops=22,157)

  • Sort Key: (first_value(ee2_9.exec_date) OVER (?))
  • Sort Method: quicksort Memory: 25kB
31. 88.628 25,170.352 ↓ 4.0 4 22,157

WindowAgg (cost=0.57..8.60 rows=1 width=16) (actual time=0.606..1.136 rows=4 loops=22,157)

32. 25,081.724 25,081.724 ↓ 4.0 4 22,157

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_9 (cost=0.57..8.59 rows=1 width=16) (actual time=0.604..1.132 rows=4 loops=22,157)

  • Index Cond: ((resolution_to_id = ee_1.resolution_to_id) AND (cdate < ee_1.cdate))
  • Filter: (exec_date IS NOT NULL)
  • Rows Removed by Filter: 0
33. 1,465.744 1,033,349.520 ↑ 1.0 1 1,465,744

Unique (cost=8.61..8.62 rows=1 width=16) (actual time=0.705..0.705 rows=1 loops=1,465,744)

34. 4,397.232 1,031,883.776 ↑ 1.0 1 1,465,744

Sort (cost=8.61..8.62 rows=1 width=16) (actual time=0.704..0.704 rows=1 loops=1,465,744)

  • Sort Key: (first_value(ee2_10."TYPE") OVER (?))
  • Sort Method: quicksort Memory: 25kB
35. 2,931.488 1,027,486.544 ↑ 1.0 1 1,465,744

WindowAgg (cost=0.57..8.60 rows=1 width=16) (actual time=0.540..0.701 rows=1 loops=1,465,744)

36. 1,024,555.056 1,024,555.056 ↑ 1.0 1 1,465,744

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_10 (cost=0.57..8.59 rows=1 width=16) (actual time=0.538..0.699 rows=1 loops=1,465,744)

  • Index Cond: ((resolution_to_id = ee_1.resolution_to_id) AND (cdate < ee_1.cdate))
37. 26.271 8,695.701 ↑ 1.0 1 26,271

Unique (cost=22.13..22.14 rows=1 width=16) (actual time=0.331..0.331 rows=1 loops=26,271)

38. 52.542 8,669.430 ↑ 1.0 1 26,271

Sort (cost=22.13..22.13 rows=1 width=16) (actual time=0.330..0.330 rows=1 loops=26,271)

  • Sort Key: (first_value(dn2_1.rdate) OVER (?))
  • Sort Method: quicksort Memory: 25kB
39. 52.542 8,616.888 ↑ 1.0 1 26,271

WindowAgg (cost=1.57..22.12 rows=1 width=16) (actual time=0.306..0.328 rows=1 loops=26,271)

40. 28.986 8,564.346 ↑ 1.0 1 26,271

Nested Loop Left Join (cost=1.57..22.10 rows=1 width=16) (actual time=0.304..0.326 rows=1 loops=26,271)

  • Filter: ((dn2_1.id IS NULL) OR ((dn2_1.n = 0) AND (dn2_1.org_id = r.r_org_id)))
  • Rows Removed by Filter: 1
41. 41.511 8,354.178 ↑ 1.0 1 26,271

Nested Loop Left Join (cost=1.00..17.05 rows=1 width=16) (actual time=0.297..0.318 rows=1 loops=26,271)

42. 2,548.287 2,548.287 ↑ 1.0 1 26,271

Index Scan Backward using exec_event_test3 on exec_event ee2_11 (cost=0.57..8.59 rows=1 width=16) (actual time=0.096..0.097 rows=1 loops=26,271)

  • Index Cond: ((resolution_to_id = ee_1.resolution_to_id) AND ("TYPE" = 3) AND (cdate < ee_1.cdate))
43. 5,764.380 5,764.380 ↓ 0.0 0 30,180

Index Scan using fk_autoidx_1 on exec_event_d eed2_1 (cost=0.43..8.45 rows=1 width=16) (actual time=0.191..0.191 rows=0 loops=30,180)

  • Index Cond: (exec_event_id = ee2_11.id)
44. 181.182 181.182 ↑ 62.0 1 30,197

Index Scan using dn_doc_id_idx on document_n dn2_1 (cost=0.57..4.12 rows=62 width=40) (actual time=0.005..0.006 rows=1 loops=30,197)

  • Index Cond: (document_id = eed2_1.document_id)
45. 26.271 236.439 ↑ 1.0 1 26,271

Unique (cost=8.62..8.62 rows=1 width=16) (actual time=0.009..0.009 rows=1 loops=26,271)

46. 52.542 210.168 ↑ 1.0 1 26,271

Sort (cost=8.62..8.62 rows=1 width=16) (actual time=0.008..0.008 rows=1 loops=26,271)

  • Sort Key: (first_value(ee2_12.exec_date) OVER (?))
  • Sort Method: quicksort Memory: 25kB
47. 26.271 157.626 ↑ 1.0 1 26,271

WindowAgg (cost=0.57..8.61 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=26,271)

48. 131.355 131.355 ↑ 1.0 1 26,271

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_12 (cost=0.57..8.59 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=26,271)

  • Index Cond: ((resolution_to_id = ee_1.resolution_to_id) AND (cdate < ee_1.cdate))
  • Filter: (""TYPE"" = ANY ('{0,1}'::bigint[]))
  • Rows Removed by Filter: 1
49. 1,439.473 10,076.311 ↑ 1.0 1 1,439,473

Unique (cost=8.61..8.62 rows=1 width=16) (actual time=0.006..0.007 rows=1 loops=1,439,473)

50. 2,878.946 8,636.838 ↑ 1.0 1 1,439,473

Sort (cost=8.61..8.62 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=1,439,473)

  • Sort Key: (first_value(ee2_13.exec_date) OVER (?))
  • Sort Method: quicksort Memory: 25kB
51. 1,439.473 5,757.892 ↑ 1.0 1 1,439,473

WindowAgg (cost=0.57..8.60 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=1,439,473)

52. 4,318.419 4,318.419 ↑ 1.0 1 1,439,473

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_13 (cost=0.57..8.59 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,439,473)

  • Index Cond: ((resolution_to_id = ee_1.resolution_to_id) AND (cdate < ee_1.cdate))
  • Filter: (exec_date IS NOT NULL)
  • Rows Removed by Filter: 0
53. 0.366 0.366 ↓ 0.0 0 122

Index Only Scan using ev_rtid_cd_idx on exec_event ee2_14 (cost=0.57..8.59 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=122)

  • Index Cond: ((resolution_to_id = ee_1.resolution_to_id) AND (cdate > ee_1.cdate))
  • Heap Fetches: 0
54. 0.122 195.200 ↑ 1.0 1 122

Unique (cost=8.61..8.62 rows=1 width=16) (actual time=1.600..1.600 rows=1 loops=122)

55. 0.366 195.078 ↓ 2.0 2 122

Sort (cost=8.61..8.62 rows=1 width=16) (actual time=1.599..1.599 rows=2 loops=122)

  • Sort Key: (first_value(ee2_15.exec_date) OVER (?))
  • Sort Method: quicksort Memory: 25kB
56. 0.366 194.712 ↓ 2.0 2 122

WindowAgg (cost=0.57..8.60 rows=1 width=16) (actual time=0.932..1.596 rows=2 loops=122)

57. 194.346 194.346 ↓ 2.0 2 122

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_15 (cost=0.57..8.59 rows=1 width=16) (actual time=0.930..1.593 rows=2 loops=122)

  • Index Cond: ((resolution_to_id = ee_1.resolution_to_id) AND (cdate < ee_1.cdate))
  • Filter: (exec_date IS NOT NULL)
  • Rows Removed by Filter: 0
58. 731,258.940 731,397.750 ↓ 0.0 0 136,074

Index Scan using dc_resolution_to_id_idx on document_control dcc (cost=0.57..30.80 rows=1 width=50) (actual time=5.375..5.375 rows=0 loops=136,074)

  • Index Cond: (resolution_to_id = rt.id)
  • Filter: ((((stop_date IS NULL) AND (is_control = 1)) OR ((stop_date >= '2018-12-27 00:00:00'::timestamp without time zone) AND (stop_date <= '2018-12-20 00:00:00'::timestamp without time zone))) AND (((stop_date IS NULL) AND (is_control = 1) AND (CASE WHEN (has_prodl IS NULL) THEN exec_date ELSE (SubPlan 15) END <= '2018-12-20 00:00:00'::timestamp without time zone)) OR ((stop_date >= '2018-12-27 00:00:00'::timestamp without time zone) AND (stop_date <= '2018-12-20 00:00:00'::timestamp without time zone))))
  • Rows Removed by Filter: 1
59.          

SubPlan (forIndex Scan)

60. 0.000 138.810 ↑ 1.0 1 70

Unique (cost=27.39..27.40 rows=1 width=16) (actual time=1.982..1.983 rows=1 loops=70)

61.          

Initplan (forUnique)

62. 0.140 82.600 ↑ 1.0 1 70

Result (cost=8.59..8.60 rows=1 width=8) (actual time=1.180..1.180 rows=1 loops=70)

63.          

Initplan (forResult)

64. 0.140 82.460 ↑ 1.0 1 70

Limit (cost=0.57..8.59 rows=1 width=8) (actual time=1.178..1.178 rows=1 loops=70)

65. 82.320 82.320 ↑ 1.0 1 70

Index Only Scan Backward using exec_event_test3 on exec_event exec_event_1 (cost=0.57..8.59 rows=1 width=8) (actual time=1.176..1.176 rows=1 loops=70)

  • Index Cond: ((resolution_to_id = rt.id) AND ("TYPE" = 0) AND (cdate IS NOT NULL))
  • Heap Fetches: 3
66. 0.420 138.600 ↑ 1.0 1 70

Sort (cost=18.79..18.79 rows=1 width=16) (actual time=1.980..1.980 rows=1 loops=70)

  • Sort Key: (first_value(eep_1.exec_date) OVER (?))
  • Sort Method: quicksort Memory: 25kB
67. 0.350 138.180 ↑ 1.0 1 70

WindowAgg (cost=18.76..18.78 rows=1 width=16) (actual time=1.973..1.974 rows=1 loops=70)

68. 0.280 137.830 ↑ 1.0 1 70

Sort (cost=18.76..18.76 rows=1 width=16) (actual time=1.969..1.969 rows=1 loops=70)

  • Sort Key: eep_1.cdate DESC
  • Sort Method: quicksort Memory: 25kB
69. 0.340 137.550 ↑ 1.0 1 70

Nested Loop Anti Join (cost=1.14..18.75 rows=1 width=16) (actual time=1.964..1.965 rows=1 loops=70)

  • Join Filter: (ee2_8.cdate <= eep_1.cdate)
  • Rows Removed by Join Filter: 4
70. 25.970 25.970 ↑ 1.0 1 70

Index Scan using ee_res_to_id_idx on exec_event eep_1 (cost=0.57..10.13 rows=1 width=16) (actual time=0.370..0.371 rows=1 loops=70)

  • Index Cond: (resolution_to_id = rt.id)
  • Filter: (("TYPE" = 0) OR (("TYPE" = 1) AND (counters = 0)))
  • Rows Removed by Filter: 4
71. 0.220 111.240 ↓ 3.0 3 90

Materialize (cost=0.57..8.60 rows=1 width=8) (actual time=1.232..1.236 rows=3 loops=90)

72. 111.020 111.020 ↓ 3.0 3 70

Index Scan using exec_event_test on exec_event ee2_8 (cost=0.57..8.59 rows=1 width=8) (actual time=1.581..1.586 rows=3 loops=70)

  • Index Cond: ((resolution_to_id = rt.id) AND ("TYPE" = 1) AND (counters = 1))
  • Filter: (cdate >= $30)
73. 0.420 0.420 ↓ 0.0 0 70

Index Only Scan using usr_ugid_idx on usr ua (cost=0.42..2.19 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=70)

  • Index Cond: ((id = dcc.author) AND (group_id = 29))
  • Heap Fetches: 0
74. 0.000 0.000 ↓ 0.0 0

Index Only Scan using usr_id_name_freq_idx on usr ur (cost=0.42..2.20 rows=1 width=22) (never executed)

  • Index Cond: (id = dcc.executor)
  • Heap Fetches: 0
75. 0.000 0.000 ↓ 0.0 0

Index Scan using resolution_order_pk on resolution_order ro (cost=0.57..3.58 rows=1 width=16) (never executed)

  • Index Cond: (id = rt.resolution_order_id)
76. 0.000 0.000 ↓ 0.0 0

Index Scan using sys_c003322_1 on usr udc (cost=0.42..3.14 rows=1 width=29) (never executed)

  • Index Cond: (id = ro.curator)
77.          

SubPlan (forNested Loop Left Join)

78. 0.000 0.000 ↓ 0.0 0

Unique (cost=27.39..27.40 rows=1 width=16) (never executed)

79.          

Initplan (forUnique)

80. 0.000 0.000 ↓ 0.0 0

Result (cost=8.59..8.60 rows=1 width=8) (never executed)

81.          

Initplan (forResult)

82. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.57..8.59 rows=1 width=8) (never executed)

83. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using exec_event_test3 on exec_event (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_to_id = rt.id) AND ("TYPE" = 0) AND (cdate IS NOT NULL))
  • Heap Fetches: 0
84. 0.000 0.000 ↓ 0.0 0

Sort (cost=18.79..18.79 rows=1 width=16) (never executed)

  • Sort Key: (first_value(eep.exec_date) OVER (?))
85. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=18.76..18.78 rows=1 width=16) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Sort (cost=18.76..18.76 rows=1 width=16) (never executed)

  • Sort Key: eep.cdate DESC
87. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=1.14..18.75 rows=1 width=16) (never executed)

  • Join Filter: (ee2.cdate <= eep.cdate)
88. 0.000 0.000 ↓ 0.0 0

Index Scan using ee_res_to_id_idx on exec_event eep (cost=0.57..10.13 rows=1 width=16) (never executed)

  • Index Cond: (resolution_to_id = rt.id)
  • Filter: (("TYPE" = 0) OR (("TYPE" = 1) AND (counters = 0)))
89. 0.000 0.000 ↓ 0.0 0

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

90. 0.000 0.000 ↓ 0.0 0

Index Scan using exec_event_test on exec_event ee2 (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Index Cond: ((resolution_to_id = rt.id) AND ("TYPE" = 1) AND (counters = 1))
  • Filter: (cdate >= $2)
91. 0.000 0.000 ↓ 0.0 0

Unique (cost=129.32..129.33 rows=1 width=12) (never executed)

92. 0.000 0.000 ↓ 0.0 0

Sort (cost=129.32..129.32 rows=1 width=12) (never executed)

  • Sort Key: (first_value(GREATEST(0, (date_part('day'::text, CASE WHEN ((ee.""TYPE"" = ANY ('{1,2,4}'::bigint[])) AND (ee.counters = 1)) THEN CASE WHEN (SubPlan 4) THEN (dn_1.rdate - (SubPlan 5)) ELSE CASE WHEN ((SubPlan 6) = 3) THEN ((SubPlan 7) - (SubPlan 8)) ELSE (CASE ee.""TYPE"" WHEN 1 THEN ee.cdate WHEN 2 THEN ee.exec_date WHEN 4 THEN ee.cdate ELSE NULL::timestamp without time zone END - (SubPlan 9)) END END ELSE CASE WHEN ((ee.""TYPE"" = 3) AND (NOT (SubPlan 10))) THEN (dn_1.rdate - (SubPlan 11)) ELSE NULL::interval END END))::integer)) OVER (?))
93. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=1.57..129.31 rows=1 width=12) (never executed)

94. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.57..38.23 rows=1 width=50) (never executed)

  • Filter: ((dn_1.id IS NULL) OR ((dn_1.n = 0) AND (dn_1.org_id = r.r_org_id)))
95. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.00..28.13 rows=2 width=42) (never executed)

96. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using ev_rtid_cd_idx on exec_event ee (cost=0.57..11.21 rows=2 width=42) (never executed)

  • Index Cond: (resolution_to_id = rt.id)
97. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_autoidx_1 on exec_event_d eed (cost=0.43..8.45 rows=1 width=16) (never executed)

  • Index Cond: (exec_event_id = ee.id)
98. 0.000 0.000 ↓ 0.0 0

Index Scan using dn_doc_id_idx on document_n dn_1 (cost=0.57..4.12 rows=62 width=40) (never executed)

  • Index Cond: (document_id = eed.document_id)
99.          

SubPlan (forWindowAgg)

100. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.14..17.19 rows=1 width=0) (never executed)

101. 0.000 0.000 ↓ 0.0 0

Index Scan using rt_primary_id_idx on resolution_to rti (cost=0.57..8.59 rows=1 width=8) (never executed)

  • Index Cond: (COALESCE(primary_id, id) = ee.resolution_to_id)
102. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (id = rti.resolution_id)
  • Filter: (document_id = dn_1.document_id)
103. 0.000 0.000 ↓ 0.0 0

Unique (cost=8.61..8.62 rows=1 width=16) (never executed)

104. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.61..8.62 rows=1 width=16) (never executed)

  • Sort Key: (first_value(ee2_1.exec_date) OVER (?))
105. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=0.57..8.60 rows=1 width=16) (never executed)

106. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_1 (cost=0.57..8.59 rows=1 width=16) (never executed)

  • Index Cond: ((resolution_to_id = ee.resolution_to_id) AND (cdate < ee.cdate))
  • Filter: (exec_date IS NOT NULL)
107. 0.000 0.000 ↓ 0.0 0

Unique (cost=8.61..8.62 rows=1 width=16) (never executed)

108. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.61..8.62 rows=1 width=16) (never executed)

  • Sort Key: (first_value(ee2_2."TYPE") OVER (?))
109. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=0.57..8.60 rows=1 width=16) (never executed)

110. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_2 (cost=0.57..8.59 rows=1 width=16) (never executed)

  • Index Cond: ((resolution_to_id = ee.resolution_to_id) AND (cdate < ee.cdate))
111. 0.000 0.000 ↓ 0.0 0

Unique (cost=22.13..22.14 rows=1 width=16) (never executed)

112. 0.000 0.000 ↓ 0.0 0

Sort (cost=22.13..22.13 rows=1 width=16) (never executed)

  • Sort Key: (first_value(dn2.rdate) OVER (?))
113. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=1.57..22.12 rows=1 width=16) (never executed)

114. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.57..22.10 rows=1 width=16) (never executed)

  • Filter: ((dn2.id IS NULL) OR ((dn2.n = 0) AND (dn2.org_id = r.r_org_id)))
115. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=1.00..17.05 rows=1 width=16) (never executed)

116. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using exec_event_test3 on exec_event ee2_3 (cost=0.57..8.59 rows=1 width=16) (never executed)

  • Index Cond: ((resolution_to_id = ee.resolution_to_id) AND ("TYPE" = 3) AND (cdate < ee.cdate))
117. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_autoidx_1 on exec_event_d eed2 (cost=0.43..8.45 rows=1 width=16) (never executed)

  • Index Cond: (exec_event_id = ee2_3.id)
118. 0.000 0.000 ↓ 0.0 0

Index Scan using dn_doc_id_idx on document_n dn2 (cost=0.57..4.12 rows=62 width=40) (never executed)

  • Index Cond: (document_id = eed2.document_id)
119. 0.000 0.000 ↓ 0.0 0

Unique (cost=8.62..8.62 rows=1 width=16) (never executed)

120. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.62..8.62 rows=1 width=16) (never executed)

  • Sort Key: (first_value(ee2_4.exec_date) OVER (?))
121. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=0.57..8.61 rows=1 width=16) (never executed)

122. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_4 (cost=0.57..8.59 rows=1 width=16) (never executed)

  • Index Cond: ((resolution_to_id = ee.resolution_to_id) AND (cdate < ee.cdate))
  • Filter: (""TYPE"" = ANY ('{0,1}'::bigint[]))
123. 0.000 0.000 ↓ 0.0 0

Unique (cost=8.61..8.62 rows=1 width=16) (never executed)

124. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.61..8.62 rows=1 width=16) (never executed)

  • Sort Key: (first_value(ee2_5.exec_date) OVER (?))
125. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=0.57..8.60 rows=1 width=16) (never executed)

126. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_5 (cost=0.57..8.59 rows=1 width=16) (never executed)

  • Index Cond: ((resolution_to_id = ee.resolution_to_id) AND (cdate < ee.cdate))
  • Filter: (exec_date IS NOT NULL)
127. 0.000 0.000 ↓ 0.0 0

Index Only Scan using ev_rtid_cd_idx on exec_event ee2_6 (cost=0.57..8.59 rows=1 width=0) (never executed)

  • Index Cond: ((resolution_to_id = ee.resolution_to_id) AND (cdate > ee.cdate))
  • Heap Fetches: 0
128. 0.000 0.000 ↓ 0.0 0

Unique (cost=8.61..8.62 rows=1 width=16) (never executed)

129. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.61..8.62 rows=1 width=16) (never executed)

  • Sort Key: (first_value(ee2_7.exec_date) OVER (?))
130. 0.000 0.000 ↓ 0.0 0

WindowAgg (cost=0.57..8.60 rows=1 width=16) (never executed)

131. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using ev_rtid_cd_idx on exec_event ee2_7 (cost=0.57..8.59 rows=1 width=16) (never executed)

  • Index Cond: ((resolution_to_id = ee.resolution_to_id) AND (cdate < ee.cdate))
  • Filter: (exec_date IS NOT NULL)