QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------- Limit (cost=1780811.95..1780811.97 rows=1 width=2952) (actual time=5322.464..5324.225 rows=1 loops=1) Buffers: shared hit=3520017 read=40962 I/O Timings: read=324.604 -> Subquery Scan on "ERP_WORK_ORDER_DDO_INFO" (cost=1780811.95..1780812.03 rows=4 width=2952) (actual time=5322.458..5324.219 rows=1 loops=1) Buffers: shared hit=3520017 read=40962 I/O Timings: read=324.604 -> HashAggregate (cost=1780811.95..1780811.99 rows=4 width=2952) (actual time=5322.450..5324.210 rows=1 loops=1) Group Key: "D"."ID", "S"."NAME", "S"."CODE", "D"."LEADCRAFT", "CC"."NAME", "RWO"."CURRENT_STATE_ID", "SS"."NAME", mrod_region."NAME", (CASE mrod_region."ID" WHEN 71 THEN 2000 ELSE CASE "ST"."MAIN_SITE_TYPE_ID" WH EN 5 THEN 44 ELSE CASE "S"."SITE_OWNER_COMPANY_ID" WHEN 2542 THEN 2542 WHEN 2543 THEN 2543 WHEN 2544 THEN 2544 ELSE 1 END END END), (CASE mrod_region."ID" WHEN 71 THEN $0 ELSE CASE "ST"."MAIN_SITE_TYPE_ID" WHEN 5 THEN $1 ELSE C ASE "S"."SITE_OWNER_COMPANY_ID" WHEN 2542 THEN $2 WHEN 2543 THEN $3 WHEN 2544 THEN $4 ELSE $5 END END END), (CASE mrod_region."ID" WHEN 71 THEN $6 ELSE CASE "ST"."MAIN_SITE_TYPE_ID" WHEN 5 THEN $7 ELSE CASE "S"."SITE_OWNER_COMP ANY_ID" WHEN 2542 THEN $8 WHEN 2543 THEN $9 WHEN 2544 THEN $10 ELSE $11 END END END), (NULL::bigint), "D"."CREATION_DATE", "CU"."LOGIN_NAME", "UU"."LOGIN_NAME", "D"."LAST_UPDATED_DATE", (NULL::bigint), (NULL::text), (NULL::bigi nt), (NULL::bigint) Batches: 1 Memory Usage: 60kB Buffers: shared hit=3520017 read=40962 I/O Timings: read=324.604 -> Append (cost=38.74..1780811.75 rows=4 width=2952) (actual time=5320.360..5324.152 rows=1 loops=1) Buffers: shared hit=3520017 read=40962 I/O Timings: read=324.604 -> Nested Loop (cost=38.74..52.13 rows=1 width=714) (actual time=0.073..0.558 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 InitPlan 1 (returns $0) -> Index Scan using "PK_COMPANY" on "COMPANY" (cost=0.27..2.49 rows=1 width=16) (never executed) Index Cond: ("ID" = 2000) InitPlan 2 (returns $1) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_1" (cost=0.27..2.49 rows=1 width=16) (never executed) Index Cond: ("ID" = 44) InitPlan 3 (returns $2) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_2" (cost=0.27..2.49 rows=1 width=16) (never executed) Index Cond: ("ID" = 2542) InitPlan 4 (returns $3) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_3" (cost=0.27..2.49 rows=1 width=16) (never executed) Index Cond: ("ID" = 2543) InitPlan 5 (returns $4) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_4" (cost=0.27..2.49 rows=1 width=16) (never executed) Index Cond: ("ID" = 2544) InitPlan 6 (returns $5) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_5" (cost=0.27..2.49 rows=1 width=16) (never executed) Index Cond: ("ID" = 1) InitPlan 7 (returns $6) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_6" (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: ("ID" = 2000) InitPlan 8 (returns $7) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_7" (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: ("ID" = 44) InitPlan 9 (returns $8) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_8" (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: ("ID" = 2542) InitPlan 10 (returns $9) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_9" (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: ("ID" = 2543) InitPlan 11 (returns $10) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_10" (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: ("ID" = 2544) InitPlan 12 (returns $11) -> Index Scan using "PK_COMPANY" on "COMPANY" "COMPANY_11" (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: ("ID" = 1) -> Nested Loop (cost=8.59..21.92 rows=1 width=119) (actual time=0.072..0.484 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Nested Loop Left Join (cost=8.16..19.27 rows=1 width=119) (actual time=0.072..0.472 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Nested Loop Left Join (cost=7.89..16.77 rows=1 width=103) (actual time=0.072..0.460 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Nested Loop Left Join (cost=4.64..12.49 rows=1 width=95) (actual time=0.072..0.164 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Nested Loop Left Join (cost=4.21..11.99 rows=1 width=95) (actual time=0.072..0.151 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Nested Loop Left Join (cost=4.07..11.83 rows=1 width=95) (actual time=0.072..0.134 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Nested Loop (cost=3.64..9.19 rows=1 width=52) (actual time=0.072..0.121 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Nested Loop (cost=3.35..6.68 rows=1 width=46) (actual time=0.071..0.108 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Bitmap Heap Scan on "DDO_WORK_ORDER" "D" (cost=3.07..4.18 rows=1 width=40) (actual time=0.071..0.087 rows=0 loops=1) Recheck Cond: (("ID" = 1495363) OR ("ID" IS NULL)) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> BitmapOr (cost=3.07..3.07 rows=1 width=0) (actual time=0.068..0.076 rows=0 loops=1) Buffers: shared hit=1 read=5 I/O Timings: read=0.037 -> Bitmap Index Scan on "PK_DDO_WORK_ORDER" (cost=0.00..1.53 rows=1 width=0) (actual time=0.048..0.052 rows=0 loops=1) Index Cond: ("ID" = 1495363) Buffers: shared read=3 I/O Timings: read=0.025 -> Bitmap Index Scan on "PK_DDO_WORK_ORDER" (cost=0.00..1.53 rows=1 width=0) (actual time=0.019..0.019 rows=0 loops=1) Index Cond: ("ID" IS NULL) Buffers: shared hit=1 read=2 I/O Timings: read=0.012 -> Index Scan using "PK_USER_N" on "USER_N" "CU" (cost=0.29..2.51 rows=1 width=14) (never executed) Index Cond: ("ID" = "D"."CREATED_BY_USER_ID") -> Index Scan using "PK_USER_N" on "USER_N" "UU" (cost=0.29..2.51 rows=1 width=14) (never executed) Index Cond: ("ID" = "D"."LAST_UPDATED_USER_ID") -> Index Scan using "SITE_ID_NO_idx" on "SITE" "S" (cost=0.42..2.64 rows=1 width=51) (never executed) Index Cond: ("ID" = "D"."SITE_ID") -> Index Scan using "PK_SITE_TYPE" on "SITE_TYPE" "ST" (cost=0.14..0.16 rows=1 width=8) (never executed) Index Cond: ("ID" = "S"."SITE_TYPE_ID") -> Index Scan using "PK_ADDRESS" on "ADDRESS" "A" (cost=0.43..0.49 rows=1 width=8) (never executed) Index Cond: ("ID" = "S"."ADDRESS_ID") -> Nested Loop (cost=3.25..4.27 rows=1 width=16) (never executed) -> Nested Loop (cost=3.11..4.06 rows=1 width=20) (never executed) -> Nested Loop (cost=2.97..3.85 rows=1 width=24) (never executed) -> Nested Loop (cost=2.83..3.65 rows=1 width=28) (never executed) -> Nested Loop (cost=2.69..3.44 rows=1 width=32) (never executed) -> Nested Loop (cost=2.55..3.23 rows=1 width=36) (never executed) -> Nested Loop (cost=2.41..3.02 rows=1 width=40) (never executed) -> Nested Loop (cost=2.27..2.82 rows=1 width=40) (never executed) -> Nested Loop (cost=2.13..2.61 rows=1 width=40) (never executed) -> Nested Loop (cost=1.98..2.41 rows=1 width=28) (never executed) -> Nested Loop (cost=1.84..2.21 rows=1 width=28) (never executed) -> Nested Loop (cost=1.70..2.01 rows=1 width=28) (never executed) -> Nested Loop (cost=1.56..1.80 rows=1 width=28) (never executed) -> Nested Loop (cost=1.41..1.63 rows=1 width=28) (never executed) -> Nested Loop (cost=1.27..1.47 rows=1 width=28) (never executed) -> Nested Loop (cost=1.13..1.30 rows=1 width=28) (never executed) -> Nested Loop (cost=0.99..1.13 rows=1 width=28) (never executed) -> Nested Loop (cost=0.84..0.97 rows=1 width=28) (never executed) -> Nested Loop (cost=0.70..0.80 rows=1 width=28) (never executed) -> Nested Loop (cost=0.56..0.63 rows=1 width=36) (never executed) -> Index Scan using "PK_COUNTY" on "COUNTY" county (cost=0.2 8..0.30 rows=1 width=8) (never executed) Index Cond: ("ID" = "A"."COUNTY_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "IX_COUNTY_RESPONSIBILITY_COUNTY_ID" on " COUNTY_RESPONSIBILITY" active_county_responsibility (cost=0.28..0.32 rows=1 width=56) (never executed) Index Cond: ("COUNTY_ID" = county."ID") -> Index Scan using "PK_CITY" on "CITY" city (cost=0.14..0.17 rows =1 width=8) (never executed) Index Cond: ("ID" = county."CITY_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" rn_subregion (cost=0.1 4..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility."RN_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" fn_subregion (cost=0.14..0.1 7 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility."FN_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" cn_subregion (cost=0.14..0.17 rows =1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility."CN_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" mrod_subregion (cost=0.14..0.17 rows=1 w idth=8) (never executed) Index Cond: ("ID" = active_county_responsibility."MROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" frod_subregion (cost=0.14..0.17 rows=1 width=8 ) (never executed) Index Cond: ("ID" = active_county_responsibility."FROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" lbs_subregion (cost=0.14..0.17 rows=1 width=8) (neve r executed) Index Cond: ("ID" = active_county_responsibility."LBS_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" rn_region (cost=0.14..0.20 rows=1 width=8) (neve r executed) Index Cond: ("ID" = rn_subregion."REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" fn_region (cost=0.14..0.20 rows=1 width=8) (never exec uted) Index Cond: ("ID" = fn_subregion."REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" cn_region (cost=0.14..0.20 rows=1 width=8) (never executed) Index Cond: ("ID" = cn_subregion."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" mrod_region (cost=0.14..0.20 rows=1 width=16) (never executed) Index Cond: ("ID" = mrod_subregion."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" frod_region (cost=0.14..0.20 rows=1 width=8) (never executed) Index Cond: ("ID" = frod_subregion."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" lbs_region (cost=0.14..0.20 rows=1 width=8) (never executed) Index Cond: ("ID" = lbs_subregion."REGION_ID") -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: rn_region."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" rn_main_region (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = rn_region."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: fn_region."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" fn_main_region (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = fn_region."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: cn_region."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" cn_main_region (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = cn_region."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: mrod_region."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" mrod_main_region (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = mrod_region."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: frod_region."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" frod_main_region (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = frod_region."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: lbs_region."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" lbs_main_region (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = lbs_region."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_COMPANY" on "COMPANY" "CC" (cost=0.27..2.49 rows=1 width=20) (never executed) Index Cond: ("ID" = "D"."LEADCRAFT") -> Index Only Scan using "WORK_ORDER_ID_CURRENT_STATE_ID_idx" on "WORK_ORDER" "RWO" (cost=0.43..2.65 rows=1 width=8) (never executed) Index Cond: ("ID" = "D"."REF_WORK_ORDER_ID") Heap Fetches: 0 -> Index Scan using "PK_SM_STATE" on "SM_STATE" "SS" (cost=0.28..0.29 rows=1 width=23) (never executed) Index Cond: ("ID" = "RWO"."CURRENT_STATE_ID") -> Subquery Scan on "*SELECT* 2" (cost=13.43..29.50 rows=1 width=230) (actual time=0.022..0.448 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Nested Loop Left Join (cost=13.43..29.49 rows=1 width=226) (actual time=0.022..0.439 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 InitPlan 13 (returns $12) -> Limit (cost=0.27..2.49 rows=1 width=4) (never executed) -> Index Scan using "IX_COMPANY_NAME" on "COMPANY" c (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: (("NAME")::text = 'GLOBALTOWER'::text) InitPlan 14 (returns $13) -> Limit (cost=0.27..2.49 rows=1 width=4) (never executed) -> Index Scan using "IX_COMPANY_NAME" on "COMPANY" c_1 (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: (("NAME")::text = 'GLOBALTOWER'::text) -> Nested Loop Left Join (cost=8.18..21.49 rows=1 width=111) (actual time=0.022..0.403 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Nested Loop Left Join (cost=7.90..18.99 rows=1 width=95) (actual time=0.022..0.386 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Nested Loop Left Join (cost=4.65..14.70 rows=1 width=91) (actual time=0.022..0.103 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Nested Loop Left Join (cost=4.23..14.21 rows=1 width=91) (actual time=0.021..0.087 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Nested Loop (cost=3.80..11.57 rows=1 width=56) (actual time=0.021..0.075 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Nested Loop (cost=3.51..9.06 rows=1 width=50) (actual time=0.021..0.057 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Nested Loop (cost=3.23..6.56 rows=1 width=44) (actual time=0.021..0.046 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Bitmap Heap Scan on "TOWER_MANAGEMENT" "TM" (cost=2.80..3.91 rows=1 width=40) (actual time=0.021..0.033 rows=0 loops=1) Recheck Cond: (("WORK_ORDER_ID" = 1495363) OR ("WORK_ORDER_ID" IS NULL)) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> BitmapOr (cost=2.80..2.80 rows=1 width=0) (actual time=0.021..0.028 rows=0 loops=1) Buffers: shared hit=3 read=1 I/O Timings: read=0.009 -> Bitmap Index Scan on "IX_WORK_ORDER_ID_TOWER_MANAGEMENT" (cost=0.00..1.40 rows=1 width=0) (actual time=0.017..0.021 rows=0 loops=1) Index Cond: ("WORK_ORDER_ID" = 1495363) Buffers: shared hit=1 read=1 I/O Timings: read=0.009 -> Bitmap Index Scan on "IX_WORK_ORDER_ID_TOWER_MANAGEMENT" (cost=0.00..1.40 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=1) Index Cond: ("WORK_ORDER_ID" IS NULL) Buffers: shared hit=2 -> Index Only Scan using "WORK_ORDER_ID_CURRENT_STATE_ID_idx" on "WORK_ORDER" "WO" (cost=0.43..2.65 rows=1 width=8) (never executed) Index Cond: ("ID" = "TM"."WORK_ORDER_ID") Heap Fetches: 0 -> Index Scan using "PK_USER_N" on "USER_N" "CU_1" (cost=0.29..2.51 rows=1 width=14) (never executed) Index Cond: ("ID" = "TM"."CREATED_BY_USER_ID") -> Index Scan using "PK_USER_N" on "USER_N" "UU_1" (cost=0.29..2.51 rows=1 width=14) (never executed) Index Cond: ("ID" = "TM"."LAST_UPDATED_USER_ID") -> Index Scan using "SITE_ID_NO_idx" on "SITE" "S_1" (cost=0.42..2.64 rows=1 width=43) (never executed) Index Cond: ("ID" = "TM"."SITE_ID") -> Index Scan using "PK_ADDRESS" on "ADDRESS" "A_1" (cost=0.43..0.49 rows=1 width=8) (never executed) Index Cond: ("ID" = "S_1"."ADDRESS_ID") -> Nested Loop (cost=3.25..4.27 rows=1 width=12) (never executed) -> Nested Loop (cost=3.11..4.06 rows=1 width=16) (never executed) -> Nested Loop (cost=2.97..3.85 rows=1 width=20) (never executed) -> Nested Loop (cost=2.83..3.65 rows=1 width=24) (never executed) -> Nested Loop (cost=2.69..3.44 rows=1 width=28) (never executed) -> Nested Loop (cost=2.55..3.23 rows=1 width=32) (never executed) -> Nested Loop (cost=2.41..3.02 rows=1 width=36) (never executed) -> Nested Loop (cost=2.27..2.82 rows=1 width=36) (never executed) -> Nested Loop (cost=2.13..2.61 rows=1 width=36) (never executed) -> Nested Loop (cost=1.98..2.41 rows=1 width=28) (never executed) -> Nested Loop (cost=1.84..2.21 rows=1 width=28) (never executed) -> Nested Loop (cost=1.70..2.01 rows=1 width=28) (never executed) -> Nested Loop (cost=1.56..1.80 rows=1 width=28) (never executed) -> Nested Loop (cost=1.41..1.63 rows=1 width=28) (never executed) -> Nested Loop (cost=1.27..1.47 rows=1 width=28) (never executed) -> Nested Loop (cost=1.13..1.30 rows=1 width=28) (never executed) -> Nested Loop (cost=0.99..1.13 rows=1 width=28) (never executed) -> Nested Loop (cost=0.84..0.97 rows=1 width=28) (never executed) -> Nested Loop (cost=0.70..0.80 rows=1 width=28) (never executed) -> Nested Loop (cost=0.56..0.63 rows=1 width=36) (never executed) -> Index Scan using "PK_COUNTY" on "COUNTY" county_1 (cost=0 .28..0.30 rows=1 width=8) (never executed) Index Cond: ("ID" = "A_1"."COUNTY_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "IX_COUNTY_RESPONSIBILITY_COUNTY_ID" on " COUNTY_RESPONSIBILITY" active_county_responsibility_1 (cost=0.28..0.32 rows=1 width=56) (never executed) Index Cond: ("COUNTY_ID" = county_1."ID") -> Index Scan using "PK_CITY" on "CITY" city_1 (cost=0.14..0.17 ro ws=1 width=8) (never executed) Index Cond: ("ID" = county_1."CITY_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" rn_subregion_1 (cost=0 .14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_1."RN_SUBREGION_ID" ) Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" fn_subregion_1 (cost=0.14..0 .17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_1."FN_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" cn_subregion_1 (cost=0.14..0.17 ro ws=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_1."CN_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" mrod_subregion_1 (cost=0.14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_1."MROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" frod_subregion_1 (cost=0.14..0.17 rows=1 width =8) (never executed) Index Cond: ("ID" = active_county_responsibility_1."FROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" lbs_subregion_1 (cost=0.14..0.17 rows=1 width=8) (ne ver executed) Index Cond: ("ID" = active_county_responsibility_1."LBS_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" rn_region_1 (cost=0.14..0.20 rows=1 width=8) (ne ver executed) Index Cond: ("ID" = rn_subregion_1."REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" fn_region_1 (cost=0.14..0.20 rows=1 width=8) (never ex ecuted) Index Cond: ("ID" = fn_subregion_1."REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" cn_region_1 (cost=0.14..0.20 rows=1 width=8) (never executed ) Index Cond: ("ID" = cn_subregion_1."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" mrod_region_1 (cost=0.14..0.20 rows=1 width=16) (never executed) Index Cond: ("ID" = mrod_subregion_1."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" frod_region_1 (cost=0.14..0.20 rows=1 width=8) (never executed) Index Cond: ("ID" = frod_subregion_1."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" lbs_region_1 (cost=0.14..0.20 rows=1 width=8) (never executed) Index Cond: ("ID" = lbs_subregion_1."REGION_ID") -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: rn_region_1."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" rn_main_region_1 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = rn_region_1."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: fn_region_1."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" fn_main_region_1 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = fn_region_1."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: cn_region_1."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" cn_main_region_1 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = cn_region_1."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: mrod_region_1."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" mrod_main_region_1 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = mrod_region_1."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: frod_region_1."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" frod_main_region_1 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = frod_region_1."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: lbs_region_1."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" lbs_main_region_1 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = lbs_region_1."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_COMPANY" on "COMPANY" "CC_1" (cost=0.27..2.49 rows=1 width=20) (never executed) Index Cond: ("ID" = "TM"."COMPANY_ID") -> Index Scan using "PK_SM_STATE" on "SM_STATE" "SS_1" (cost=0.28..0.29 rows=1 width=23) (never executed) Index Cond: ("ID" = "WO"."CURRENT_STATE_ID") SubPlan 15 -> Limit (cost=0.42..2.73 rows=1 width=4) (never executed) -> Index Scan using "IX_STANDARD_TASK_TOWER_MANAGEMENT_ID" on "STANDARD_TASK" st (cost=0.42..2.73 rows=1 width=4) (never executed) Index Cond: ("TOWER_MANAGEMENT_ID" = "TM"."ID") Filter: (("PROJECT_TYPE_ID" IS NOT NULL) AND ("MAIN_TASK_ID" = 0) AND ("IS_DELETED" = 0)) -> Subquery Scan on "*SELECT* 3" (cost=230847.09..879271.83 rows=1 width=207) (actual time=5320.255..5322.467 rows=1 loops=1) Buffers: shared hit=3520013 read=40955 I/O Timings: read=324.546 -> Nested Loop (cost=230847.09..879271.81 rows=1 width=189) (actual time=5320.246..5322.451 rows=1 loops=1) Buffers: shared hit=3520013 read=40955 I/O Timings: read=324.546 InitPlan 16 (returns $15) -> Limit (cost=0.27..2.49 rows=1 width=4) (actual time=0.090..0.091 rows=1 loops=1) Buffers: shared hit=1 read=2 I/O Timings: read=0.028 -> Index Scan using "IX_COMPANY_NAME" on "COMPANY" c_2 (cost=0.27..2.49 rows=1 width=4) (actual time=0.082..0.082 rows=1 loops=1) Index Cond: (("NAME")::text = 'SUPERONLINE'::text) Buffers: shared hit=1 read=2 I/O Timings: read=0.028 -> Hash Join (cost=230844.46..879269.15 rows=1 width=186) (actual time=5320.063..5322.263 rows=1 loops=1) Hash Cond: (wf_ins."InstanceId" = "DP"."INSTANCE_ID") Buffers: shared hit=3520010 read=40953 I/O Timings: read=324.518 -> Nested Loop Left Join (cost=230824.32..877403.40 rows=492162 width=38) (actual time=1798.127..5280.226 rows=474919 loops=1) Buffers: shared hit=3519946 read=40948 I/O Timings: read=324.471 -> Hash Right Join (cost=230824.17..865093.27 rows=492162 width=19) (actual time=1798.110..5096.805 rows=474919 loops=1) Hash Cond: (wf_cstp."InstanceId" = wf_ins."InstanceId") Join Filter: ((wf_ins."StatusCd")::text = 'CMP'::text) Buffers: shared hit=3519866 read=40948 I/O Timings: read=324.471 -> Index Scan using "IX_T_WF_STEP_StepDefTypeCd" on "T_WF_STEP" wf_cstp (cost=0.43..634234.12 rows=3956 width=8) (actual time=0.102..2935.602 rows=802454 loops=1) Index Cond: (("StepDefTypeCd")::text = 'End'::text) Filter: ("StepId" = (SubPlan 20)) Rows Removed by Filter: 625 Buffers: shared hit=2637108 read=7184 I/O Timings: read=67.512 SubPlan 20 -> Result (cost=0.49..0.50 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=803079) Buffers: shared hit=2403399 read=6508 I/O Timings: read=61.039 InitPlan 19 (returns $19) -> Limit (cost=0.43..0.49 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=803079) Buffers: shared hit=2403399 read=6508 I/O Timings: read=61.039 -> Index Only Scan Backward using "T_WF_STEP_InstanceId_StepId_idx" on "T_WF_STEP" "T_WF_STEP_1" (cost=0.43..3.80 rows=58 width=8) (actual time=0.002..0 .002 rows=1 loops=803079) Index Cond: (("InstanceId" = wf_cstp."InstanceId") AND ("StepId" IS NOT NULL)) Heap Fetches: 635 Buffers: shared hit=2403399 read=6508 I/O Timings: read=61.039 -> Hash (cost=224671.71..224671.71 rows=492162 width=22) (actual time=1795.995..1796.031 rows=474919 loops=1) Buckets: 524288 Batches: 1 Memory Usage: 29323kB Buffers: shared hit=882758 read=33764 I/O Timings: read=256.959 -> Merge Left Join (cost=157480.13..224671.71 rows=492162 width=22) (actual time=1259.528..1699.219 rows=474919 loops=1) Merge Cond: (wf_ins."InstanceId" = wf_stp."InstanceId") Buffers: shared hit=882758 read=33764 I/O Timings: read=256.959 -> Index Scan using "T_WF_INSTANCE_InstanceId_ApplicationCd_idx" on "T_WF_INSTANCE" wf_ins (cost=0.43..65950.55 rows=492162 width=38) (actual time=10.175..284.928 rows=474919 loops=1) Index Cond: (("ApplicationCd")::text = 'ONENT_SabitKurulum'::text) Buffers: shared hit=76480 read=5474 I/O Timings: read=44.479 -> Sort (cost=157479.70..157482.71 rows=1206 width=8) (actual time=1248.374..1270.458 rows=213362 loops=1) Sort Key: wf_stp."InstanceId" Sort Method: quicksort Memory: 16146kB Buffers: shared hit=806278 read=28290 I/O Timings: read=212.480 -> Index Scan using "IX_T_WF_STEP_StatusCd" on "T_WF_STEP" wf_stp (cost=0.43..157417.98 rows=1206 width=8) (actual time=0.099..1187.336 rows=213370 loops=1) Index Cond: (("StatusCd")::text = ANY ('{P,Q,S,T,U,W}'::text[])) Filter: ("StepId" = (SubPlan 18)) Rows Removed by Filter: 21069 Buffers: shared hit=806278 read=28290 I/O Timings: read=212.480 SubPlan 18 -> Result (cost=0.49..0.50 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=234439) Buffers: shared hit=700450 read=28277 I/O Timings: read=212.347 InitPlan 17 (returns $17) -> Limit (cost=0.43..0.49 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=234439) Buffers: shared hit=700450 read=28277 I/O Timings: read=212.347 -> Index Only Scan Backward using "T_WF_STEP_InstanceId_StepId_idx" on "T_WF_STEP" (cost=0.43..3.80 rows=58 width=8) (actual time=0.00 3..0.003 rows=1 loops=234439) Index Cond: (("InstanceId" = wf_stp."InstanceId") AND ("StepId" IS NOT NULL)) Heap Fetches: 15597 Buffers: shared hit=700450 read=28277 I/O Timings: read=212.347 -> Memoize (cost=0.15..0.17 rows=1 width=31) (actual time=0.000..0.000 rows=1 loops=474919) Cache Key: (wf_ins."EntityStatusCd")::text Cache Mode: logical Hits: 474879 Misses: 40 Evictions: 0 Overflows: 0 Memory Usage: 6kB Buffers: shared hit=80 -> Index Scan using "IX_T_WF_WORKFLOWSTATUS_Code" on "T_WF_WORKFLOWSTATUS" wf_sts (cost=0.14..0.16 rows=1 width=31) (actual time=0.003..0.003 rows=1 loops=40) Index Cond: (("Code")::text = (wf_ins."EntityStatusCd")::text) Buffers: shared hit=80 -> Hash (cost=20.13..20.13 rows=1 width=164) (actual time=0.364..0.764 rows=1 loops=1) Buckets: 1024 Batches: 1 Memory Usage: 9kB Buffers: shared hit=64 read=5 I/O Timings: read=0.046 -> Nested Loop Left Join (cost=8.01..20.13 rows=1 width=164) (actual time=0.356..0.760 rows=1 loops=1) Buffers: shared hit=64 read=5 I/O Timings: read=0.046 -> Nested Loop Left Join (cost=7.74..17.63 rows=1 width=148) (actual time=0.344..0.734 rows=1 loops=1) Buffers: shared hit=61 read=5 I/O Timings: read=0.046 -> Nested Loop Left Join (cost=4.49..13.34 rows=1 width=144) (actual time=0.157..0.242 rows=1 loops=1) Buffers: shared hit=17 read=5 I/O Timings: read=0.046 -> Nested Loop Left Join (cost=4.06..12.85 rows=1 width=144) (actual time=0.137..0.210 rows=1 loops=1) Buffers: shared hit=13 read=5 I/O Timings: read=0.046 -> Nested Loop (cost=3.64..10.21 rows=1 width=109) (actual time=0.117..0.174 rows=1 loops=1) Buffers: shared hit=9 read=5 I/O Timings: read=0.046 -> Nested Loop (cost=3.35..7.70 rows=1 width=103) (actual time=0.096..0.139 rows=1 loops=1) Join Filter: ("DP"."TENANT_ID" = "T"."ID") Buffers: shared hit=6 read=5 I/O Timings: read=0.046 -> Nested Loop (cost=3.35..6.68 rows=1 width=94) (actual time=0.080..0.112 rows=1 loops=1) Buffers: shared hit=6 read=4 I/O Timings: read=0.038 -> Bitmap Heap Scan on "DDO_PACKAGE" "DP" (cost=3.06..4.17 rows=1 width=88) (actual time=0.060..0.075 rows=1 loops=1) Recheck Cond: (("ID" = 1495363) OR ("ID" IS NULL)) Heap Blocks: exact=1 Buffers: shared hit=3 read=4 I/O Timings: read=0.038 -> BitmapOr (cost=3.06..3.06 rows=1 width=0) (actual time=0.044..0.052 rows=0 loops=1) Buffers: shared hit=3 read=3 I/O Timings: read=0.027 -> Bitmap Index Scan on "DDO_PACKAGE_pkey" (cost=0.00..1.53 rows=1 width=0) (actual time=0.038..0.041 rows=1 loops=1) Index Cond: ("ID" = 1495363) Buffers: shared read=3 I/O Timings: read=0.027 -> Bitmap Index Scan on "DDO_PACKAGE_pkey" (cost=0.00..1.53 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=1) Index Cond: ("ID" IS NULL) Buffers: shared hit=3 -> Index Scan using "PK_USER_N" on "USER_N" "CU_2" (cost=0.29..2.51 rows=1 width=14) (actual time=0.015..0.023 rows=1 loops=1) Index Cond: ("ID" = "DP"."CREATED_BY_USER_ID") Buffers: shared hit=3 -> Seq Scan on "TENANT" "T" (cost=0.00..1.01 rows=1 width=13) (actual time=0.014..0.017 rows=1 loops=1) Buffers: shared read=1 I/O Timings: read=0.008 -> Index Scan using "PK_USER_N" on "USER_N" "UU_2" (cost=0.29..2.51 rows=1 width=14) (actual time=0.019..0.023 rows=1 loops=1) Index Cond: ("ID" = "DP"."LAST_UPDATED_USER_ID") Buffers: shared hit=3 -> Index Scan using "SITE_ID_NO_idx" on "SITE" "S_2" (cost=0.42..2.64 rows=1 width=43) (actual time=0.018..0.022 rows=1 loops=1) Index Cond: ("ID" = "DP"."SITE_ID") Buffers: shared hit=4 -> Index Scan using "PK_ADDRESS" on "ADDRESS" "A_2" (cost=0.43..0.49 rows=1 width=8) (actual time=0.019..0.023 rows=1 loops=1) Index Cond: ("ID" = "S_2"."ADDRESS_ID") Buffers: shared hit=4 -> Nested Loop (cost=3.25..4.27 rows=1 width=12) (actual time=0.186..0.478 rows=1 loops=1) Buffers: shared hit=44 -> Nested Loop (cost=3.11..4.06 rows=1 width=16) (actual time=0.179..0.452 rows=1 loops=1) Buffers: shared hit=42 -> Nested Loop (cost=2.97..3.85 rows=1 width=20) (actual time=0.172..0.427 rows=1 loops=1) Buffers: shared hit=40 -> Nested Loop (cost=2.83..3.65 rows=1 width=24) (actual time=0.164..0.397 rows=1 loops=1) Buffers: shared hit=38 -> Nested Loop (cost=2.69..3.44 rows=1 width=28) (actual time=0.157..0.379 rows=1 loops=1) Buffers: shared hit=36 -> Nested Loop (cost=2.55..3.23 rows=1 width=32) (actual time=0.152..0.354 rows=1 loops=1) Buffers: shared hit=34 -> Nested Loop (cost=2.41..3.02 rows=1 width=36) (actual time=0.139..0.324 rows=1 loops=1) Buffers: shared hit=32 -> Nested Loop (cost=2.27..2.82 rows=1 width=36) (actual time=0.130..0.306 rows=1 loops=1) Buffers: shared hit=30 -> Nested Loop (cost=2.13..2.61 rows=1 width=36) (actual time=0.125..0.286 rows=1 loops=1) Buffers: shared hit=28 -> Nested Loop (cost=1.98..2.41 rows=1 width=28) (actual time=0.120..0.269 rows=1 loops=1) Buffers: shared hit=26 -> Nested Loop (cost=1.84..2.21 rows=1 width=28) (actual time=0.110..0.249 rows=1 loops=1) Buffers: shared hit=24 -> Nested Loop (cost=1.70..2.01 rows=1 width=28) (actual time=0.105..0.223 rows=1 loops=1) Buffers: shared hit=22 -> Nested Loop (cost=1.56..1.80 rows=1 width=28) (actual time=0.091..0.196 rows=1 loops=1) Buffers: shared hit=20 -> Nested Loop (cost=1.41..1.63 rows=1 width=28) (actual time=0.083..0.172 rows=1 loops=1) Buffers: shared hit=18 -> Nested Loop (cost=1.27..1.47 rows=1 width=28) (actual time=0.078..0.156 rows=1 lo ops=1) Buffers: shared hit=16 -> Nested Loop (cost=1.13..1.30 rows=1 width=28) (actual time=0.072..0.138 row s=1 loops=1) Buffers: shared hit=14 -> Nested Loop (cost=0.99..1.13 rows=1 width=28) (actual time=0.065..0.1 20 rows=1 loops=1) Buffers: shared hit=12 -> Nested Loop (cost=0.84..0.97 rows=1 width=28) (actual time=0.05 5..0.098 rows=1 loops=1) Buffers: shared hit=10 -> Nested Loop (cost=0.70..0.80 rows=1 width=28) (actual tim e=0.046..0.078 rows=1 loops=1) Buffers: shared hit=8 -> Nested Loop (cost=0.56..0.63 rows=1 width=36) (actu al time=0.023..0.043 rows=1 loops=1) Buffers: shared hit=6 -> Index Scan using "PK_COUNTY" on "COUNTY" count y_2 (cost=0.28..0.30 rows=1 width=8) (actual time=0.011..0.015 rows=1 loops=1) Index Cond: ("ID" = "A_2"."COUNTY_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=3 -> Index Scan using "IX_COUNTY_RESPONSIBILITY_COU NTY_ID" on "COUNTY_RESPONSIBILITY" active_county_responsibility_2 (cost=0.28..0.32 rows=1 width=56) (actual time=0.011..0.015 rows=1 loops=1) Index Cond: ("COUNTY_ID" = county_2."ID") Buffers: shared hit=3 -> Index Scan using "PK_CITY" on "CITY" city_2 (cost=0 .14..0.17 rows=1 width=8) (actual time=0.022..0.025 rows=1 loops=1) Index Cond: ("ID" = county_2."CITY_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "PK_SUBREGION" on "SUBREGION" rn_subregio n_2 (cost=0.14..0.17 rows=1 width=8) (actual time=0.009..0.012 rows=1 loops=1) Index Cond: ("ID" = active_county_responsibility_2."RN_S UBREGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "PK_SUBREGION" on "SUBREGION" fn_subregion_2 ( cost=0.14..0.17 rows=1 width=8) (actual time=0.009..0.013 rows=1 loops=1) Index Cond: ("ID" = active_county_responsibility_2."FN_SUBREGI ON_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "PK_SUBREGION" on "SUBREGION" cn_subregion_2 (cost=0 .14..0.17 rows=1 width=8) (actual time=0.006..0.010 rows=1 loops=1) Index Cond: ("ID" = active_county_responsibility_2."CN_SUBREGION_ID" ) Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "PK_SUBREGION" on "SUBREGION" mrod_subregion_2 (cost=0.14. .0.17 rows=1 width=8) (actual time=0.004..0.008 rows=1 loops=1) Index Cond: ("ID" = active_county_responsibility_2."MROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "PK_SUBREGION" on "SUBREGION" frod_subregion_2 (cost=0.14..0.17 rows=1 width=8) (actual time=0.005..0.008 rows=1 loops=1) Index Cond: ("ID" = active_county_responsibility_2."FROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "PK_SUBREGION" on "SUBREGION" lbs_subregion_2 (cost=0.14..0.17 rows=1 width=8) (actual time=0.007..0.016 rows=1 loops=1) Index Cond: ("ID" = active_county_responsibility_2."LBS_SUBREGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" rn_region_2 (cost=0.14..0.20 rows=1 width=8) (actual time=0.012..0.017 rows=1 loops=1) Index Cond: ("ID" = rn_subregion_2."REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" fn_region_2 (cost=0.14..0.20 rows=1 width= 8) (actual time=0.005..0.009 rows=1 loops=1) Index Cond: ("ID" = fn_subregion_2."REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" cn_region_2 (cost=0.14..0.20 rows=1 width=8) (ac tual time=0.009..0.012 rows=1 loops=1) Index Cond: ("ID" = cn_subregion_2."REGION_ID") Buffers: shared hit=2 -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" mrod_region_2 (cost=0.14..0.20 rows=1 width=16) (actua l time=0.004..0.008 rows=1 loops=1) Index Cond: ("ID" = mrod_subregion_2."REGION_ID") Buffers: shared hit=2 -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" frod_region_2 (cost=0.14..0.20 rows=1 width=8) (actual time= 0.004..0.008 rows=1 loops=1) Index Cond: ("ID" = frod_subregion_2."REGION_ID") Buffers: shared hit=2 -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" lbs_region_2 (cost=0.14..0.20 rows=1 width=8) (actual time=0.007.. 0.011 rows=1 loops=1) Index Cond: ("ID" = lbs_subregion_2."REGION_ID") Buffers: shared hit=2 -> Memoize (cost=0.14..0.20 rows=1 width=4) (actual time=0.012..0.020 rows=1 loops=1) Cache Key: rn_region_2."MAIN_REGION_ID" Cache Mode: logical Hits: 0 Misses: 1 Evictions: 0 Overflows: 0 Memory Usage: 1kB Buffers: shared hit=2 -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" rn_main_region_2 (cost=0.13..0.19 rows=1 width=4) (actual time=0.009..0. 013 rows=1 loops=1) Index Cond: ("ID" = rn_region_2."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Memoize (cost=0.14..0.20 rows=1 width=4) (actual time=0.005..0.017 rows=1 loops=1) Cache Key: fn_region_2."MAIN_REGION_ID" Cache Mode: logical Hits: 0 Misses: 1 Evictions: 0 Overflows: 0 Memory Usage: 1kB Buffers: shared hit=2 -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" fn_main_region_2 (cost=0.13..0.19 rows=1 width=4) (actual time=0.004..0.008 ro ws=1 loops=1) Index Cond: ("ID" = fn_region_2."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Memoize (cost=0.14..0.20 rows=1 width=4) (actual time=0.006..0.010 rows=1 loops=1) Cache Key: cn_region_2."MAIN_REGION_ID" Cache Mode: logical Hits: 0 Misses: 1 Evictions: 0 Overflows: 0 Memory Usage: 1kB Buffers: shared hit=2 -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" cn_main_region_2 (cost=0.13..0.19 rows=1 width=4) (actual time=0.005..0.005 rows=1 l oops=1) Index Cond: ("ID" = cn_region_2."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Memoize (cost=0.14..0.20 rows=1 width=4) (actual time=0.008..0.018 rows=1 loops=1) Cache Key: mrod_region_2."MAIN_REGION_ID" Cache Mode: logical Hits: 0 Misses: 1 Evictions: 0 Overflows: 0 Memory Usage: 1kB Buffers: shared hit=2 -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" mrod_main_region_2 (cost=0.13..0.19 rows=1 width=4) (actual time=0.007..0.013 rows=1 loops =1) Index Cond: ("ID" = mrod_region_2."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Memoize (cost=0.14..0.20 rows=1 width=4) (actual time=0.007..0.015 rows=1 loops=1) Cache Key: frod_region_2."MAIN_REGION_ID" Cache Mode: logical Hits: 0 Misses: 1 Evictions: 0 Overflows: 0 Memory Usage: 1kB Buffers: shared hit=2 -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" frod_main_region_2 (cost=0.13..0.19 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1) Index Cond: ("ID" = frod_region_2."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Memoize (cost=0.14..0.20 rows=1 width=4) (actual time=0.006..0.014 rows=1 loops=1) Cache Key: lbs_region_2."MAIN_REGION_ID" Cache Mode: logical Hits: 0 Misses: 1 Evictions: 0 Overflows: 0 Memory Usage: 1kB Buffers: shared hit=2 -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" lbs_main_region_2 (cost=0.13..0.19 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=1) Index Cond: ("ID" = lbs_region_2."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) Buffers: shared hit=2 -> Index Scan using "PK_COMPANY" on "COMPANY" "CC_2" (cost=0.27..2.49 rows=1 width=20) (actual time=0.011..0.014 rows=1 loops=1) Index Cond: ("ID" = "DP"."TEAM_ID") Buffers: shared hit=3 -> Index Scan using "IX_T_WF_WORKFLOWSTATUS_Code" on "T_WF_WORKFLOWSTATUS" (cost=0.14..0.16 rows=1 width=14) (actual time=0.027..0.027 rows=1 loops=1) Index Cond: (("Code")::text = (wf_ins."EntityStatusCd")::text) Filter: ("GCRecId" IS NULL) Buffers: shared hit=2 -> Subquery Scan on "*SELECT* 4" (cost=791976.74..901458.26 rows=1 width=207) (actual time=0.244..0.644 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop (cost=791976.74..901458.25 rows=1 width=205) (actual time=0.231..0.631 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 InitPlan 21 (returns $20) -> Limit (cost=0.27..2.49 rows=1 width=4) (never executed) -> Index Scan using "IX_COMPANY_NAME" on "COMPANY" c_3 (cost=0.27..2.49 rows=1 width=4) (never executed) Index Cond: (("NAME")::text = 'DBS'::text) -> Hash Join (cost=791974.11..901455.59 rows=1 width=186) (actual time=0.215..0.598 rows=0 loops=1) Hash Cond: ("WF_INS"."InstanceId" = "DP_1"."INSTANCE_ID") Buffers: shared read=1 I/O Timings: read=0.012 -> Hash Left Join (cost=791954.91..897004.08 rows=1181946 width=38) (never executed) Hash Cond: (("WF_INS"."EntityStatusCd")::text = ("WF_STS"."Code")::text) -> Merge Left Join (cost=791950.61..880781.12 rows=1181946 width=19) (never executed) Merge Cond: ("WF_INS"."InstanceId" = "WF_CSTP"."InstanceId") Join Filter: (("WF_INS"."StatusCd")::text = 'CMP'::text) -> Merge Left Join (cost=157480.13..243286.54 rows=1181946 width=22) (never executed) Merge Cond: ("WF_INS"."InstanceId" = "WF_STP"."InstanceId") -> Index Scan using "T_WF_INSTANCE_pkey" on "T_WF_INSTANCE" "WF_INS" (cost=0.43..82833.88 rows=1181946 width=38) (never executed) -> Sort (cost=157479.70..157482.71 rows=1206 width=8) (never executed) Sort Key: "WF_STP"."InstanceId" -> Index Scan using "IX_T_WF_STEP_StatusCd" on "T_WF_STEP" "WF_STP" (cost=0.43..157417.98 rows=1206 width=8) (never executed) Index Cond: (("StatusCd")::text = ANY ('{P,Q,S,T,U,W}'::text[])) Filter: ("StepId" = (SubPlan 23)) SubPlan 23 -> Result (cost=0.49..0.50 rows=1 width=8) (never executed) InitPlan 22 (returns $22) -> Limit (cost=0.43..0.49 rows=1 width=8) (never executed) -> Index Only Scan Backward using "T_WF_STEP_InstanceId_StepId_idx" on "T_WF_STEP" "T_WF_STEP_2" (cost=0.43..3.80 rows=58 width=8) (never ex ecuted) Index Cond: (("InstanceId" = "WF_STP"."InstanceId") AND ("StepId" IS NOT NULL)) Heap Fetches: 0 -> Sort (cost=634470.49..634480.38 rows=3956 width=8) (never executed) Sort Key: "WF_CSTP"."InstanceId" -> Index Scan using "IX_T_WF_STEP_StepDefTypeCd" on "T_WF_STEP" "WF_CSTP" (cost=0.43..634234.12 rows=3956 width=8) (never executed) Index Cond: (("StepDefTypeCd")::text = 'End'::text) Filter: ("StepId" = (SubPlan 25)) SubPlan 25 -> Result (cost=0.49..0.50 rows=1 width=8) (never executed) InitPlan 24 (returns $24) -> Limit (cost=0.43..0.49 rows=1 width=8) (never executed) -> Index Only Scan Backward using "T_WF_STEP_InstanceId_StepId_idx" on "T_WF_STEP" "T_WF_STEP_3" (cost=0.43..3.80 rows=58 width=8) (never executed ) Index Cond: (("InstanceId" = "WF_CSTP"."InstanceId") AND ("StepId" IS NOT NULL)) Heap Fetches: 0 -> Hash (cost=3.02..3.02 rows=102 width=31) (never executed) -> Seq Scan on "T_WF_WORKFLOWSTATUS" "WF_STS" (cost=0.00..3.02 rows=102 width=31) (never executed) -> Hash (cost=19.19..19.19 rows=1 width=164) (actual time=0.116..0.427 rows=0 loops=1) Buckets: 1024 Batches: 1 Memory Usage: 8kB Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop Left Join (cost=4.95..19.19 rows=1 width=164) (actual time=0.111..0.421 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop Left Join (cost=4.68..14.48 rows=1 width=148) (actual time=0.103..0.409 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop Left Join (cost=1.43..10.20 rows=1 width=144) (actual time=0.093..0.133 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop Left Join (cost=1.00..9.70 rows=1 width=144) (actual time=0.085..0.119 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop (cost=0.57..7.06 rows=1 width=109) (actual time=0.077..0.103 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop (cost=0.29..4.55 rows=1 width=103) (actual time=0.070..0.088 rows=0 loops=1) Join Filter: ("DP_1"."TENANT_ID" = "T_1"."ID") Buffers: shared read=1 I/O Timings: read=0.012 -> Nested Loop (cost=0.29..3.53 rows=1 width=94) (actual time=0.061..0.076 rows=0 loops=1) Buffers: shared read=1 I/O Timings: read=0.012 -> Seq Scan on "DDO" "DP_1" (cost=0.00..1.02 rows=1 width=88) (actual time=0.052..0.055 rows=0 loops=1) Filter: (("ID" = 1495363) OR ("ID" IS NULL)) Rows Removed by Filter: 2 Buffers: shared read=1 I/O Timings: read=0.012 -> Index Scan using "PK_USER_N" on "USER_N" "CU_3" (cost=0.29..2.51 rows=1 width=14) (never executed) Index Cond: ("ID" = "DP_1"."CREATED_BY_USER_ID") -> Seq Scan on "TENANT" "T_1" (cost=0.00..1.01 rows=1 width=13) (never executed) -> Index Scan using "PK_USER_N" on "USER_N" "UU_3" (cost=0.29..2.51 rows=1 width=14) (never executed) Index Cond: ("ID" = "DP_1"."LAST_UPDATED_USER_ID") -> Index Scan using "SITE_ID_NO_idx" on "SITE" "S_3" (cost=0.42..2.64 rows=1 width=43) (never executed) Index Cond: ("ID" = "DP_1"."SITE_ID") -> Index Scan using "PK_ADDRESS" on "ADDRESS" "A_3" (cost=0.43..0.49 rows=1 width=8) (never executed) Index Cond: ("ID" = "S_3"."ADDRESS_ID") -> Nested Loop (cost=3.25..4.27 rows=1 width=12) (never executed) -> Nested Loop (cost=3.11..4.06 rows=1 width=16) (never executed) -> Nested Loop (cost=2.97..3.85 rows=1 width=20) (never executed) -> Nested Loop (cost=2.83..3.65 rows=1 width=24) (never executed) -> Nested Loop (cost=2.69..3.44 rows=1 width=28) (never executed) -> Nested Loop (cost=2.55..3.23 rows=1 width=32) (never executed) -> Nested Loop (cost=2.41..3.02 rows=1 width=36) (never executed) -> Nested Loop (cost=2.27..2.82 rows=1 width=36) (never executed) -> Nested Loop (cost=2.13..2.61 rows=1 width=36) (never executed) -> Nested Loop (cost=1.98..2.41 rows=1 width=28) (never executed) -> Nested Loop (cost=1.84..2.21 rows=1 width=28) (never executed) -> Nested Loop (cost=1.70..2.01 rows=1 width=28) (never executed) -> Nested Loop (cost=1.56..1.80 rows=1 width=28) (never executed) -> Nested Loop (cost=1.41..1.63 rows=1 width=28) (never executed) -> Nested Loop (cost=1.27..1.47 rows=1 width=28) (never executed) -> Nested Loop (cost=1.13..1.30 rows=1 width=28) (never executed) -> Nested Loop (cost=0.99..1.13 rows=1 width=28) (never executed) -> Nested Loop (cost=0.84..0.97 rows=1 width=28) (never executed) -> Nested Loop (cost=0.70..0.80 rows=1 width=28) (never exec uted) -> Nested Loop (cost=0.56..0.63 rows=1 width=36) (neve r executed) -> Index Scan using "PK_COUNTY" on "COUNTY" count y_3 (cost=0.28..0.30 rows=1 width=8) (never executed) Index Cond: ("ID" = "A_3"."COUNTY_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "IX_COUNTY_RESPONSIBILITY_COU NTY_ID" on "COUNTY_RESPONSIBILITY" active_county_responsibility_3 (cost=0.28..0.32 rows=1 width=56) (never executed) Index Cond: ("COUNTY_ID" = county_3."ID") -> Index Scan using "PK_CITY" on "CITY" city_3 (cost=0 .14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = county_3."CITY_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" rn_subregio n_3 (cost=0.14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_3."RN_S UBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" fn_subregion_3 ( cost=0.14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_3."FN_SUBREGI ON_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" cn_subregion_3 (cost=0 .14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_3."CN_SUBREGION_ID" ) Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" mrod_subregion_3 (cost=0.14. .0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_3."MROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" frod_subregion_3 (cost=0.14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_3."FROD_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_SUBREGION" on "SUBREGION" lbs_subregion_3 (cost=0.14..0.17 rows=1 width=8) (never executed) Index Cond: ("ID" = active_county_responsibility_3."LBS_SUBREGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" rn_region_3 (cost=0.14..0.20 rows=1 width=8) (never executed) Index Cond: ("ID" = rn_subregion_3."REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" fn_region_3 (cost=0.14..0.20 rows=1 width= 8) (never executed) Index Cond: ("ID" = fn_subregion_3."REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" cn_region_3 (cost=0.14..0.20 rows=1 width=8) (ne ver executed) Index Cond: ("ID" = cn_subregion_3."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" mrod_region_3 (cost=0.14..0.20 rows=1 width=16) (never executed) Index Cond: ("ID" = mrod_subregion_3."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" frod_region_3 (cost=0.14..0.20 rows=1 width=8) (never execut ed) Index Cond: ("ID" = frod_subregion_3."REGION_ID") -> Index Scan using "REGION_ID_DIVISION_ID_idx" on "REGION" lbs_region_3 (cost=0.14..0.20 rows=1 width=8) (never executed) Index Cond: ("ID" = lbs_subregion_3."REGION_ID") -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: rn_region_3."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" rn_main_region_3 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = rn_region_3."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: fn_region_3."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" fn_main_region_3 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = fn_region_3."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: cn_region_3."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" cn_main_region_3 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = cn_region_3."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: mrod_region_3."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" mrod_main_region_3 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = mrod_region_3."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: frod_region_3."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" frod_main_region_3 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = frod_region_3."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Memoize (cost=0.14..0.20 rows=1 width=4) (never executed) Cache Key: lbs_region_3."MAIN_REGION_ID" Cache Mode: logical -> Index Scan using "PK_MAIN_REGION" on "MAIN_REGION" lbs_main_region_3 (cost=0.13..0.19 rows=1 width=4) (never executed) Index Cond: ("ID" = lbs_region_3."MAIN_REGION_ID") Filter: ("IS_DELETED" = 0) -> Index Scan using "PK_COMPANY" on "COMPANY" "CC_3" (cost=0.27..2.49 rows=1 width=20) (never executed) Index Cond: ("ID" = "DP_1"."TEAM_ID") -> Index Scan using "IX_T_WF_WORKFLOWSTATUS_Code" on "T_WF_WORKFLOWSTATUS" "T_WF_WORKFLOWSTATUS_1" (cost=0.14..0.16 rows=1 width=14) (never executed) Index Cond: (("Code")::text = ("WF_INS"."EntityStatusCd")::text) Filter: ("GCRecId" IS NULL) Planning: Buffers: shared hit=2939 read=130 I/O Timings: read=1.240 Planning Time: 607.059 ms Execution Time: 5329.752 ms