Sort (cost=101161.84..101161.85 rows=4 width=226) (actual time=113110.725..113110.731 rows=4 loops=1) Sort Key: "CH"."chargeNo", "CH"."chargeSeqNo" Sort Method: quicksort Memory: 18kB -> Hash Left Join (cost=82004.90..101161.80 rows=4 width=226) (actual time=110701.127..113110.637 rows=4 loops=1) Hash Cond: (("CH"."sevClsCode")::bpchar = ("S"."sevClsCode")::bpchar) -> Hash Left Join (cost=82003.36..101160.20 rows=4 width=195) (actual time=110701.005..113110.503 rows=4 loops=1) Hash Cond: (("CH"."modSevClsCode")::bpchar = ("M"."sevClsCode")::bpchar) -> Hash Left Join (cost=82001.82..101158.64 rows=4 width=164) (actual time=110700.858..113110.345 rows=4 loops=1) Hash Cond: (("CH"."pleaCode")::bpchar = ("PC"."pleaCode")::bpchar) -> Hash Left Join (cost=82000.60..101157.37 rows=4 width=128) (actual time=110700.720..113110.191 rows=4 loops=1) Hash Cond: ((("CHST"."eventType")::bpchar = ("CTHE"."eventType")::bpchar) AND (("CHST"."caseType")::bpchar = ("CTHE"."caseType")::bpchar) AND (("CHST"."countyNo")::smallint = ("CTHE"."countyNo")::smallint)) -> Nested Loop Left Join (cost=0.00..87.70 rows=4 width=107) (actual time=0.189..0.241 rows=4 loops=1) -> Index Scan using "Charge_pkey" on "Charge" "CH" (cost=0.00..10.32 rows=4 width=94) (actual time=0.174..0.186 rows=4 loops=1) Index Cond: ((("countyNo")::smallint = 53) AND (("caseNo")::bpchar = '2007CM003476'::bpchar)) -> Index Scan using "CaseHist_pkey" on "CaseHist" "CHST" (cost=0.00..19.32 rows=2 width=32) (actual time=0.002..0.002 rows=0 loops=4) Index Cond: ((("CHST"."countyNo")::smallint = 53) AND (("CHST"."caseNo")::bpchar = '2007CM003476'::bpchar) AND (("CHST"."histSeqNo")::smallint = ("CH"."reopHistSeqNo")::smallint)) -> Hash (cost=44597.18..44597.18 rows=1146024 width=98) (actual time=110700.290..110700.290 rows=1146024 loops=1) -> Subquery Scan "CTHE" (cost=148.78..44597.18 rows=1146024 width=98) (actual time=14.673..92707.265 rows=1146024 loops=1) -> Merge Left Join (cost=148.78..33136.94 rows=1146024 width=77) (actual time=14.668..72106.330 rows=1146024 loops=1) Merge Cond: (((b."caseType")::bpchar = (d."caseType")::bpchar) AND ((b."eventType")::bpchar = (d."eventType")::bpchar)) Join Filter: ((d."countyNo")::smallint = (c."countyNo")::smallint) -> Nested Loop (cost=2.79..23557.55 rows=1146024 width=67) (actual time=0.114..32623.571 rows=1146024 loops=1) -> Index Scan using "CaseTypeHistEventB_pkey" on "CaseTypeHistEventB" b (cost=0.00..634.28 rows=15917 width=65) (actual time=0.071..2405.293 rows=15917 loops=1) -> Materialize (cost=2.79..3.51 rows=72 width=2) (actual time=0.002..0.516 rows=72 loops=15917) -> Seq Scan on "ControlRecord" c (cost=0.00..2.72 rows=72 width=2) (actual time=0.031..0.183 rows=72 loops=1) -> Sort (cost=145.99..151.14 rows=2060 width=15) (actual time=14.530..207.873 rows=148249 loops=1) Sort Key: d."caseType", d."eventType" Sort Method: quicksort Memory: 145kB -> Seq Scan on "CaseTypeHistEventD" d (cost=0.00..32.60 rows=2060 width=15) (actual time=0.039..3.364 rows=2060 loops=1) -> Hash (cost=1.10..1.10 rows=10 width=41) (actual time=0.061..0.061 rows=10 loops=1) -> Seq Scan on "PleaCode" "PC" (cost=0.00..1.10 rows=10 width=41) (actual time=0.023..0.037 rows=10 loops=1) -> Hash (cost=1.24..1.24 rows=24 width=34) (actual time=0.106..0.106 rows=24 loops=1) -> Seq Scan on "SevClsCode" "M" (cost=0.00..1.24 rows=24 width=34) (actual time=0.024..0.057 rows=24 loops=1) -> Hash (cost=1.24..1.24 rows=24 width=34) (actual time=0.087..0.087 rows=24 loops=1) -> Seq Scan on "SevClsCode" "S" (cost=0.00..1.24 rows=24 width=34) (actual time=0.006..0.039 rows=24 loops=1) Total runtime: 113114.552 ms