explain
(
                SELECT
                                "C"."caseNo",
                                "C"."filingDate",
                                "CY"."countyName",
                                "S"."descr" AS "statusCodeDescr",
                                "P"."nameF",
                                "P"."nameM",
                                "P"."nameL",
                                "P"."suffix",
                                "P"."dob",
                                "C"."caption",
                                "CY"."countyNo",
                                "C"."caseType",
                                "C"."isSeal",
                                "C"."isPartySeal",
                                "LCM"."lastModified",
                                "P"."searchName",
                                CASE WHEN (("C"."filingDate" >= DATE  '2008-11-01')
                                                AND ("C"."wcisClsCode" = '30709'))
                                        OR (("C"."caseType" IN ('CV','FA'))
                                                AND ("C"."wcisClsCode" = '30711')
                                                AND (EXISTS
                                                (
                                                        SELECT
                                                                        1
                                                                FROM
                                                                        "CaseHist" "CH"
                                                                WHERE (
                                                                            ("C"."countyNo" = "CH"."countyNo")
                                                                        AND ("C"."caseNo" = "CH"."caseNo")
                                                                        AND ("CH"."eventType" IN ('FWBCA','CCTRO')))
                                                ))) THEN TRUE ELSE FALSE END AS "isPetitionerSeal"
                        FROM
                                "Case" "C"
                                JOIN "Party" "P"
                                        ON (("C"."caseNo" = "P"."caseNo")
                                                AND ("C"."countyNo" = "P"."countyNo")
                                                AND ((1 = 1))
                                                AND ((("P"."partyType" IN ('JV','CH'))
                                                                AND ("C"."caseType" = 'ZZ'))
                                                        OR ("P"."partyType" NOT IN ('JV','CH'))))
                                JOIN "StatusCode" "S"
                                        ON ("C"."statusCode" = "S"."statusCode")
                                JOIN "County" "CY"
                                        ON ("C"."countyNo" = "CY"."countyNo")
                                LEFT OUTER JOIN "CaseDispo" "CD"
                                        ON (("CD"."caseNo" = "C"."caseNo")
                                                AND ("CD"."countyNo" = "C"."countyNo")
                                                AND (NOT (EXISTS
                                                (
                                                        SELECT
                                                                        1
                                                                FROM
                                                                        "CaseDispo" "CD2"
                                                                WHERE (
                                                                            ("CD2"."caseNo" = "CD"."caseNo")
                                                                        AND ("CD2"."countyNo" = "CD"."countyNo")
                                                                        AND ("CD2"."dispoDate" > "CD"."dispoDate"))
                                                ))))
                                LEFT OUTER JOIN "LastCaseMod" "LCM"
                                        ON (("LCM"."caseNo" = "C"."caseNo")
                                                AND ("LCM"."countyNo" = "C"."countyNo")
                                                AND ("LCM"."updateTypeId" = 0))
                                LEFT OUTER JOIN "WccaPermCaseType" "WPCT"
                                        ON (("C"."caseType" = "WPCT"."caseType")
                                                AND ("C"."countyNo" = "WPCT"."countyNo")
                                                AND ("WPCT"."profileName" = 'PUBLIC'))
                        WHERE (
                                    (("WPCT"."profileName" IS NOT NULL)
                                        OR (("C"."caseType" IN ('PA','JD'))
                                                AND ("C"."isConfidential" = FALSE)))
                                AND ("C"."isExpunge" <> TRUE)
                                AND (NOT (("WPCT"."profileName" = 'PUBLIC')
                                        AND ("C"."caseType" = 'FA')
                                        AND ("C"."wcisClsCode" = '40501')))
                                AND (NOT (EXISTS
                                (
                                        SELECT
                                                        1
                                                FROM
                                                        "HiddenCase" "HCA"
                                                WHERE (
                                                            ("HCA"."caseNo" = "C"."caseNo")
                                                        AND ("HCA"."countyNo" = "C"."countyNo"))
                                )))
                                AND ("P"."isSeal" = FALSE)
                                AND (NOT (("P"."partyType" IN ('PE','PL','JP'))
                                        AND ((("C"."filingDate" >= DATE  '2008-11-01')
                                                        AND ("C"."wcisClsCode" = '30709'))
                                                OR (("C"."caseType" IN ('CV','FA'))
                                                        AND ("C"."wcisClsCode" = '30711')
                                                        AND (EXISTS
                                                        (
                                                                SELECT
                                                                                1
                                                                        FROM
                                                                                "CaseHist" "CHPET"
                                                                        WHERE (
                                                                                    ("C"."countyNo" = "CHPET"."countyNo")
                                                                                AND ("C"."caseNo" = "CHPET"."caseNo")
                                                                                AND ("CHPET"."eventType" IN ('FWBCA','CCTRO')))
                                                        ))))))
                                AND ((1 = 1))
                                AND ("P"."searchName" LIKE 'HILL,J%')
                                AND ((1 = 1))
                                AND (NOT (("C"."caseType" IN ('CF','CI','CM','CT','FO','TR'))
                                        AND ("P"."partyType" <> 'DE')))
                                AND ((("C"."caseType" IN ('JA','JC','JG','JM','JO','JV','JI','TP'))
                                                AND ("P"."partyType" IN ('CH','JV')))
                                        OR (("C"."caseType" NOT IN ('JA','JC','JG','JM','JO','JV','JI','TP'))
                                                AND ("P"."partyType" NOT IN ('CH','JV'))))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1)))
                UNION
                SELECT
                                "C"."caseNo",
                                "C"."filingDate",
                                "CY"."countyName",
                                "S"."descr" AS "statusCodeDescr",
                                "AL"."nameF",
                                "AL"."nameM",
                                "AL"."nameL",
                                "AL"."suffix",
                                "AL"."dob",
                                "C"."caption",
                                "CY"."countyNo",
                                "C"."caseType",
                                "C"."isSeal",
                                "C"."isPartySeal",
                                "LCM"."lastModified",
                                "AL"."searchName",
                                CASE WHEN (("C"."filingDate" >= DATE  '2008-11-01')
                                                AND ("C"."wcisClsCode" = '30709'))
                                        OR (("C"."caseType" IN ('CV','FA'))
                                                AND ("C"."wcisClsCode" = '30711')
                                                AND (EXISTS
                                                (
                                                        SELECT
                                                                        1
                                                                FROM
                                                                        "CaseHist" "CH"
                                                                WHERE (
                                                                            ("C"."countyNo" = "CH"."countyNo")
                                                                        AND ("C"."caseNo" = "CH"."caseNo")
                                                                        AND ("CH"."eventType" IN ('FWBCA','CCTRO')))
                                                ))) THEN TRUE ELSE FALSE END AS "isPetitionerSeal"
                        FROM
                                "Case" "C"
                                JOIN "Party" "P"
                                        ON (("C"."caseNo" = "P"."caseNo")
                                                AND ("C"."countyNo" = "P"."countyNo")
                                                AND ((("P"."partyType" IN ('JV','CH'))
                                                                AND ("C"."caseType" = 'ZZ'))
                                                        OR ("P"."partyType" NOT IN ('JV','CH'))))
                                JOIN "Alias" "AL"
                                        ON (("P"."caseNo" = "AL"."caseNo")
                                                AND ("P"."countyNo" = "AL"."countyNo")
                                                AND ("P"."partyNo" = "AL"."partyNo")
                                                AND ((1 = 1)))
                                JOIN "StatusCode" "S"
                                        ON ("C"."statusCode" = "S"."statusCode")
                                JOIN "County" "CY"
                                        ON ("C"."countyNo" = "CY"."countyNo")
                                LEFT OUTER JOIN "CaseDispo" "CD"
                                        ON (("CD"."caseNo" = "C"."caseNo")
                                                AND ("CD"."countyNo" = "C"."countyNo")
                                                AND (NOT (EXISTS
                                                (
                                                        SELECT
                                                                        1
                                                                FROM
                                                                        "CaseDispo" "CD2"
                                                                WHERE (
                                                                            ("CD2"."caseNo" = "CD"."caseNo")
                                                                        AND ("CD2"."countyNo" = "CD"."countyNo")
                                                                        AND ("CD2"."dispoDate" > "CD"."dispoDate"))
                                                ))))
                                LEFT OUTER JOIN "LastCaseMod" "LCM"
                                        ON (("LCM"."caseNo" = "C"."caseNo")
                                                AND ("LCM"."countyNo" = "C"."countyNo")
                                                AND ("LCM"."updateTypeId" = 0))
                                LEFT OUTER JOIN "WccaPermCaseType" "WPCT"
                                        ON (("C"."caseType" = "WPCT"."caseType")
                                                AND ("C"."countyNo" = "WPCT"."countyNo")
                                                AND ("WPCT"."profileName" = 'PUBLIC'))
                        WHERE (
                                    (("WPCT"."profileName" IS NOT NULL)
                                        OR (("C"."caseType" IN ('PA','JD'))
                                                AND ("C"."isConfidential" = FALSE)))
                                AND ("C"."isExpunge" <> TRUE)
                                AND (NOT (("WPCT"."profileName" = 'PUBLIC')
                                        AND ("C"."caseType" = 'FA')
                                        AND ("C"."wcisClsCode" = '40501')))
                                AND (NOT (EXISTS
                                (
                                        SELECT
                                                        1
                                                FROM
                                                        "HiddenCase" "HCA"
                                                WHERE (
                                                            ("HCA"."caseNo" = "C"."caseNo")
                                                        AND ("HCA"."countyNo" = "C"."countyNo"))
                                )))
                                AND ("P"."isSeal" = FALSE)
                                AND (NOT (("P"."partyType" IN ('PE','PL','JP'))
                                        AND ((("C"."filingDate" >= DATE  '2008-11-01')
                                                        AND ("C"."wcisClsCode" = '30709'))
                                                OR (("C"."caseType" IN ('CV','FA'))
                                                        AND ("C"."wcisClsCode" = '30711')
                                                        AND (EXISTS
                                                        (
                                                                SELECT
                                                                                1
                                                                        FROM
                                                                                "CaseHist" "CHPET"
                                                                        WHERE (
                                                                                    ("C"."countyNo" = "CHPET"."countyNo")
                                                                                AND ("C"."caseNo" = "CHPET"."caseNo")
                                                                                AND ("CHPET"."eventType" IN ('FWBCA','CCTRO')))
                                                        ))))))
                                AND ((1 = 1))
                                AND ("AL"."searchName" LIKE 'HILL,J%')
                                AND ((1 = 1))
                                AND (NOT (("C"."caseType" IN ('CF','CI','CM','CT','FO','TR'))
                                        AND ("P"."partyType" <> 'DE')))
                                AND ((("C"."caseType" IN ('JA','JC','JG','JM','JO','JV','JI','TP'))
                                                AND ("P"."partyType" IN ('CH','JV')))
                                        OR (("C"."caseType" NOT IN ('JA','JC','JG','JM','JO','JV','JI','TP'))
                                                AND ("P"."partyType" NOT IN ('CH','JV'))))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))
                                AND ((1 = 1))))

                ORDER BY
                        "caseNo"
;
