Nested Loop (cost=3.74..10625759612.26 rows=8552 width=154) Join Filter: ((("inner"."startDate")::date < ("outer"."startDate")::date) AND (NOT (subplan))) -> Nested Loop (cost=3.74..7745457469.59 rows=19212 width=134) -> HashAggregate (cost=3.74..3.75 rows=1 width=10) -> Index Scan using "JuryControl_pkey" on "JuryControl" jc (cost=0.00..3.73 rows=1 width=10) Index Cond: (("countyNo")::smallint = 40) -> Index Scan using "Action_juror" on "Action" (cost=0.00..7745457179.00 rows=22948 width=126) Index Cond: ((("Action"."countyNo")::smallint = 40) AND (("Action"."juryYear")::bpchar = ("outer"."juryYear")::bpchar)) Filter: ((("actionCode")::bpchar <> 'APOOL'::bpchar) AND (("actionCode")::bpchar <> 'RPOOL'::bpchar) AND (("actionCode")::bpchar <> 'APAN'::bpchar) AND (("actionCode")::bpchar <> 'RPAN'::bpchar) AND (("actionCode")::bpchar <> 'MPOOL'::bpchar) AND (("actionCode")::bpchar <> 'MPAN'::bpchar) AND (("actionCode")::bpchar <> 'PR'::bpchar) AND (("actionCode")::bpchar <> 'JPP'::bpchar) AND (("actionCode")::bpchar <> 'MFROM'::bpchar) AND (("actionCode")::bpchar <> 'MNEXT'::bpchar) AND ((("poolId" IS NULL) AND (subplan)) OR (("panelId" IS NULL) AND (subplan)))) SubPlan -> Bitmap Heap Scan on "Action" a1 (cost=61464.26..66040.00 rows=56202 width=14) Recheck Cond: ((((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'APAN'::bpchar)) OR ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'MPAN'::bpchar))) AND (("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer)) -> BitmapAnd (cost=61464.26..61464.26 rows=2412 width=0) -> BitmapOr (cost=54868.69..54868.69 rows=56690 width=0) -> Bitmap Index Scan on "Action_juror" (cost=0.00..27434.34 rows=50656 width=0) Index Cond: ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'APAN'::bpchar)) -> Bitmap Index Scan on "Action_juror" (cost=0.00..27434.34 rows=6034 width=0) Index Cond: ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'MPAN'::bpchar)) -> Bitmap Index Scan on "Action_pkey" (cost=0.00..6595.32 rows=625386 width=0) Index Cond: ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer)) -> Bitmap Heap Scan on "Action" a1 (cost=61464.26..66687.17 rows=64460 width=14) Recheck Cond: ((((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'APOOL'::bpchar)) OR ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'MPOOL'::bpchar))) AND (("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer)) -> BitmapAnd (cost=61464.26..61464.26 rows=2767 width=0) -> BitmapOr (cost=54868.69..54868.69 rows=65029 width=0) -> Bitmap Index Scan on "Action_juror" (cost=0.00..27434.34 rows=58995 width=0) Index Cond: ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'APOOL'::bpchar)) -> Bitmap Index Scan on "Action_juror" (cost=0.00..27434.34 rows=6034 width=0) Index Cond: ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer) AND (("actionCode")::bpchar = 'MPOOL'::bpchar)) -> Bitmap Index Scan on "Action_pkey" (cost=0.00..6595.32 rows=625386 width=0) Index Cond: ((("countyNo")::smallint = 40) AND (("actionSeqNo")::integer < ($0)::integer)) -> Index Scan using "Action_juror" on "Action" a2 (cost=0.00..10.22 rows=1 width=50) Index Cond: (((a2."countyNo")::smallint = 40) AND ((a2."juryYear")::bpchar = ("outer"."juryYear")::bpchar) AND ((a2."jurorId")::integer = ("outer"."jurorId")::integer)) Filter: ((("actionCode")::bpchar = 'APOOL'::bpchar) OR (("actionCode")::bpchar = 'RPOOL'::bpchar) OR (("actionCode")::bpchar = 'APAN'::bpchar) OR (("actionCode")::bpchar = 'RPAN'::bpchar) OR (("actionCode")::bpchar = 'MPOOL'::bpchar) OR (("actionCode")::bpchar = 'MPAN'::bpchar)) SubPlan -> Index Scan using "Action_pkey" on "Action" a3 (cost=0.00..299820.98 rows=1039 width=14) Index Cond: (("countyNo")::smallint = 40) Filter: (((("actionCode")::bpchar = 'APOOL'::bpchar) OR (("actionCode")::bpchar = 'RPOOL'::bpchar) OR (("actionCode")::bpchar = 'APAN'::bpchar) OR (("actionCode")::bpchar = 'RPAN'::bpchar) OR (("actionCode")::bpchar = 'MPOOL'::bpchar) OR (("actionCode")::bpchar = 'MPAN'::bpchar)) AND (("startDate")::date < ($7)::date) AND (("startDate")::date >= ($8)::date) AND ((("startDate")::date > ($8)::date) OR (("actionSeqNo")::integer > ($9)::integer))) (37 rows)