Sort (cost=6527553.48..6527557.93 rows=1780 width=136) Sort Key: "C"."caseNo" -> HashAggregate (cost=6527439.58..6527457.38 rows=1780 width=136) -> Append (cost=1427589.68..6527363.93 rows=1780 width=136) -> Hash Join (cost=1427589.68..4318080.12 rows=1710 width=136) Hash Cond: (("C"."statusCode")::text = ("S"."statusCode")::text) -> Hash Join (cost=1427588.47..3564784.93 rows=1710 width=130) Hash Cond: (("C"."countyNo")::smallint = ("CY"."countyNo")::smallint) -> Nested Loop Left Join (cost=1427585.81..3564758.75 rows=1710 width=123) -> Merge Right Join (cost=1427585.81..3554854.12 rows=1710 width=115) Merge Cond: ((("CD"."countyNo")::smallint = ("C"."countyNo")::smallint) AND (("CD"."caseNo")::text = ("C"."caseNo")::text)) -> Merge Anti Join (cost=0.00..2069318.25 rows=11628008 width=15) Merge Cond: (("CD"."countyNo")::smallint = ("CD2"."countyNo")::smallint) Join Filter: ((("CD2"."dispoDate")::date > ("CD"."dispoDate")::date) AND (("CD2"."caseNo")::text = ("CD"."caseNo")::text)) -> Index Scan using "CaseDispo_pkey" on "CaseDispo" "CD" (cost=0.00..1068306.86 rows=17442012 width=19) -> Index Scan using "CaseDispo_CountyNoDispoDate" on "CaseDispo" "CD2" (cost=0.00..913801.31 rows=17442012 width=19) -> Sort (cost=1427479.14..1427483.42 rows=1710 width=115) Sort Key: "C"."countyNo", "C"."caseNo" -> Nested Loop Left Join (cost=0.00..1427387.32 rows=1710 width=115) Filter: ((("WPCT"."profileName" IS NOT NULL) OR ((("C"."caseType")::text = ANY ('{PA,JD}'::text[])) AND (NOT "C"."isConfidential"))) AND ((("WPCT"."profileName")::text <> 'PUBLIC'::text) OR (("C"."caseType")::text <> 'FA'::text) OR (("C"."wcisClsCode")::text <> '40501'::text))) -> Nested Loop Anti Join (cost=0.00..1426785.85 rows=1710 width=116) -> Nested Loop (cost=0.00..1422756.42 rows=2911 width=116) Join Filter: ((((("P"."partyType")::text = ANY ('{JV,CH}'::text[])) AND (("C"."caseType")::text = 'ZZ'::text)) OR (("P"."partyType")::text <> ALL ('{JV,CH}'::text[]))) AND ((("C"."caseType")::text <> ALL ('{CF,CI,CM,CT,FO,TR}'::text[])) OR (("P"."partyType")::text = 'DE'::text)) AND (((("C"."caseType")::text = ANY ('{JA,JC,JG,JM,JO,JV,JI,TP}'::text[])) AND (("P"."partyType")::text = ANY ('{CH,JV}'::text[]))) OR ((("C"."caseType")::text <> ALL ('{JA,JC,JG,JM,JO,JV,JI,TP}'::text[])) AND (("P"."partyType")::text <> ALL ('{CH,JV}'::text[])))) AND ((("P"."partyType")::text <> ALL ('{PE,PL,JP}'::text[])) OR (((("C"."filingDate")::date < '2008-11-01'::date) OR (("C"."wcisClsCode")::text <> '30709'::text)) AND ((("C"."caseType")::text <> ALL ('{CV,FA}'::text[])) OR (("C"."wcisClsCode")::text <> '30711'::text) OR (NOT (alternative subplans)))))) -> Index Scan using "Party_SearchName" on "Party" "P" (cost=0.00..14.35 rows=3149 width=60) Index Cond: ((("searchName")::text >= 'HILL,J'::text) AND (("searchName")::text < 'HILL,K'::text)) Filter: ((NOT "isSeal") AND (("searchName")::text ~~ 'HILL,J%'::text)) -> Index Scan using "Case_pkey" on "Case" "C" (cost=0.00..11.24 rows=1 width=72) Index Cond: ((("C"."countyNo")::smallint = ("P"."countyNo")::smallint) AND (("C"."caseNo")::text = ("P"."caseNo")::text)) Filter: ("C"."isExpunge" <> true) SubPlan -> Seq Scan on "CaseHist" "CHPET" (cost=0.00..5046725.00 rows=494620 width=15) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) -> Index Scan using "CaseHist_pkey" on "CaseHist" "CHPET" (cost=0.00..440.50 rows=1 width=0) Index Cond: ((($0)::smallint = ("countyNo")::smallint) AND (($1)::text = ("caseNo")::text)) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) -> Index Scan using "HiddenCase_pkey" on "HiddenCase" "HCA" (cost=0.00..1.37 rows=1 width=15) Index Cond: ((("HCA"."countyNo")::smallint = ("C"."countyNo")::smallint) AND (("HCA"."caseNo")::text = ("C"."caseNo")::text)) -> Index Scan using "WccaPermCaseType_ProfileName" on "WccaPermCaseType" "WPCT" (cost=0.00..0.33 rows=1 width=26) Index Cond: ((("WPCT"."profileName")::text = 'PUBLIC'::text) AND (("C"."caseType")::text = ("WPCT"."caseType")::text) AND (("C"."countyNo")::smallint = ("WPCT"."countyNo")::smallint)) -> Index Scan using "LastCaseMod_pkey" on "LastCaseMod" "LCM" (cost=0.00..5.78 rows=1 width=23) Index Cond: ((("LCM"."countyNo")::smallint = ("C"."countyNo")::smallint) AND (("LCM"."caseNo")::text = ("C"."caseNo")::text) AND (("LCM"."updateTypeId")::integer = 0)) -> Hash (cost=1.74..1.74 rows=74 width=9) -> Seq Scan on "County" "CY" (cost=0.00..1.74 rows=74 width=9) -> Hash (cost=1.09..1.09 rows=9 width=12) -> Seq Scan on "StatusCode" "S" (cost=0.00..1.09 rows=9 width=12) SubPlan -> Seq Scan on "CaseHist" "CH" (cost=0.00..5046725.00 rows=494620 width=15) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) -> Index Scan using "CaseHist_pkey" on "CaseHist" "CH" (cost=0.00..440.50 rows=1 width=0) Index Cond: ((($0)::smallint = ("countyNo")::smallint) AND (($1)::text = ("caseNo")::text)) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) -> Hash Join (cost=1783.00..2209266.01 rows=70 width=140) Hash Cond: (("C"."statusCode")::text = ("S"."statusCode")::text) -> Hash Join (cost=1781.80..2178428.21 rows=70 width=134) Hash Cond: (("C"."countyNo")::smallint = ("CY"."countyNo")::smallint) -> Nested Loop Left Join (cost=1779.13..2178424.58 rows=70 width=129) -> Nested Loop Left Join (cost=1779.13..2178019.13 rows=70 width=121) Filter: ((("WPCT"."profileName" IS NOT NULL) OR ((("C"."caseType")::text = ANY ('{PA,JD}'::text[])) AND (NOT "C"."isConfidential"))) AND ((("WPCT"."profileName")::text <> 'PUBLIC'::text) OR (("C"."caseType")::text <> 'FA'::text) OR (("C"."wcisClsCode")::text <> '40501'::text))) -> Nested Loop (cost=1779.13..2177994.51 rows=70 width=122) Join Filter: ((((("P"."partyType")::text = ANY ('{JV,CH}'::text[])) AND (("C"."caseType")::text = 'ZZ'::text)) OR (("P"."partyType")::text <> ALL ('{JV,CH}'::text[]))) AND ((("C"."caseType")::text <> ALL ('{CF,CI,CM,CT,FO,TR}'::text[])) OR (("P"."partyType")::text = 'DE'::text)) AND (((("C"."caseType")::text = ANY ('{JA,JC,JG,JM,JO,JV,JI,TP}'::text[])) AND (("P"."partyType")::text = ANY ('{CH,JV}'::text[]))) OR ((("C"."caseType")::text <> ALL ('{JA,JC,JG,JM,JO,JV,JI,TP}'::text[])) AND (("P"."partyType")::text <> ALL ('{CH,JV}'::text[])))) AND ((("P"."partyType")::text <> ALL ('{PE,PL,JP}'::text[])) OR (((("C"."filingDate")::date < '2008-11-01'::date) OR (("C"."wcisClsCode")::text <> '30709'::text)) AND ((("C"."caseType")::text <> ALL ('{CV,FA}'::text[])) OR (("C"."wcisClsCode")::text <> '30711'::text) OR (NOT (alternative subplans)))))) -> Nested Loop Anti Join (cost=1779.13..2129278.50 rows=107 width=135) -> Merge Right Join (cost=1779.13..2129026.58 rows=182 width=135) Merge Cond: ((("CD"."countyNo")::smallint = ("C"."countyNo")::smallint) AND (("CD"."caseNo")::text = ("C"."caseNo")::text)) -> Merge Anti Join (cost=0.00..2069318.25 rows=11628008 width=15) Merge Cond: (("CD"."countyNo")::smallint = ("CD2"."countyNo")::smallint) Join Filter: ((("CD2"."dispoDate")::date > ("CD"."dispoDate")::date) AND (("CD2"."caseNo")::text = ("CD"."caseNo")::text)) -> Index Scan using "CaseDispo_pkey" on "CaseDispo" "CD" (cost=0.00..1068306.86 rows=17442012 width=19) -> Index Scan using "CaseDispo_CountyNoDispoDate" on "CaseDispo" "CD2" (cost=0.00..913801.31 rows=17442012 width=19) -> Sort (cost=1672.47..1672.92 rows=182 width=135) Sort Key: "C"."countyNo", "C"."caseNo" -> Nested Loop (cost=0.00..1665.64 rows=182 width=135) -> Index Scan using "Alias_SearchName" on "Alias" "AL" (cost=0.00..8.71 rows=146 width=63) Index Cond: ((("searchName")::text >= 'HILL,J'::text) AND (("searchName")::text < 'HILL,K'::text)) Filter: (("searchName")::text ~~ 'HILL,J%'::text) -> Index Scan using "Case_pkey" on "Case" "C" (cost=0.00..11.33 rows=1 width=72) Index Cond: ((("C"."countyNo")::smallint = ("AL"."countyNo")::smallint) AND (("C"."caseNo")::text = ("AL"."caseNo")::text)) Filter: ("C"."isExpunge" <> true) -> Index Scan using "HiddenCase_pkey" on "HiddenCase" "HCA" (cost=0.00..1.37 rows=1 width=15) Index Cond: ((("HCA"."countyNo")::smallint = ("C"."countyNo")::smallint) AND (("HCA"."caseNo")::text = ("C"."caseNo")::text)) -> Index Scan using "Party_pkey" on "Party" "P" (cost=0.00..14.72 rows=1 width=20) Index Cond: ((("P"."countyNo")::smallint = ("C"."countyNo")::smallint) AND (("P"."caseNo")::text = ("C"."caseNo")::text) AND (("P"."partyNo")::smallint = ("AL"."partyNo")::smallint)) Filter: (NOT "P"."isSeal") SubPlan -> Seq Scan on "CaseHist" "CHPET" (cost=0.00..5046725.00 rows=494620 width=15) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) -> Index Scan using "CaseHist_pkey" on "CaseHist" "CHPET" (cost=0.00..440.50 rows=1 width=0) Index Cond: ((($0)::smallint = ("countyNo")::smallint) AND (($1)::text = ("caseNo")::text)) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) -> Index Scan using "WccaPermCaseType_ProfileName" on "WccaPermCaseType" "WPCT" (cost=0.00..0.33 rows=1 width=26) Index Cond: ((("WPCT"."profileName")::text = 'PUBLIC'::text) AND (("C"."caseType")::text = ("WPCT"."caseType")::text) AND (("C"."countyNo")::smallint = ("WPCT"."countyNo")::smallint)) -> Index Scan using "LastCaseMod_pkey" on "LastCaseMod" "LCM" (cost=0.00..5.78 rows=1 width=23) Index Cond: ((("LCM"."countyNo")::smallint = ("C"."countyNo")::smallint) AND (("LCM"."caseNo")::text = ("C"."caseNo")::text) AND (("LCM"."updateTypeId")::integer = 0)) -> Hash (cost=1.74..1.74 rows=74 width=9) -> Seq Scan on "County" "CY" (cost=0.00..1.74 rows=74 width=9) -> Hash (cost=1.09..1.09 rows=9 width=12) -> Seq Scan on "StatusCode" "S" (cost=0.00..1.09 rows=9 width=12) SubPlan -> Seq Scan on "CaseHist" "CH" (cost=0.00..5046725.00 rows=494620 width=15) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) -> Index Scan using "CaseHist_pkey" on "CaseHist" "CH" (cost=0.00..440.50 rows=1 width=0) Index Cond: ((($0)::smallint = ("countyNo")::smallint) AND (($1)::text = ("caseNo")::text)) Filter: (("eventType")::text = ANY ('{FWBCA,CCTRO}'::text[])) (102 rows)