                                                                                                                                                                                                                                                                                                                                                              QUERY PLAN                                                                                                                                                                                                                                                                                                                                                               
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=176420.04..176420.05 rows=1 width=8) (actual time=457.035..457.974 rows=1 loops=1)
   ->  Gather  (cost=120083.10..176417.85 rows=125 width=45) (actual time=311.639..457.225 rows=499 loops=1)
         Workers Planned: 2
         Workers Launched: 2
         ->  Parallel Hash Anti Join  (cost=119083.10..175405.35 rows=52 width=45) (actual time=309.084..452.471 rows=166 loops=3)
               Hash Cond: ((sire.reqte_endpoint_id = sire2.reqte_endpoint_id) AND (sire.reqtde_endpoint_id = sire2.reqtde_endpoint_id) AND ((sire.record_guid)::text = (sire2.record_guid)::text))
               Join Filter: ((sire2.separation_request_id <> sire.separation_request_id) AND (sire2.reqt_processing_completed_dts < sire.reqt_processing_completed_dts))
               Rows Removed by Join Filter: 167
               ->  Parallel Index Scan using xif11sep_info_report_extract on sep_info_report_extract sire  (cost=0.56..56321.62 rows=52 width=60) (actual time=1.275..144.492 rows=166 loops=3)
                     Index Cond: ((reqt_processing_completed_dts >= '2022-08-01 00:00:00'::timestamp without time zone) AND (reqt_processing_completed_dts <= '2022-08-31 23:59:59'::timestamp without time zone))
                     Filter: (((reqt_failed_ind)::text <> '1'::text) AND ((reqxt_failed_ind IS NULL) OR ((reqxt_failed_ind)::text <> '1'::text)) AND ((resxt_failed_ind IS NULL) OR ((resxt_failed_ind)::text <> '1'::text)) AND ((reqtde_organization_type)::text <> 'SEW_EMPLOYER'::text) AND (req_valid_ind = '1'::numeric) AND (reqte_endpoint_id = '1'::numeric(38,0)) AND (reqtde_endpoint_id = '507650'::numeric(38,0)) AND (((res_valid_ind = '1'::numeric) AND ((rest_failed_ind)::text <> '1'::text)) OR ((res_valid_ind IS NULL) AND (rest_failed_ind IS NULL))) AND ((rest_processing_completed_dts IS NOT NULL) OR (response_due_date < date_trunc('day'::text, timezone('America/New_York'::text, clock_timestamp())))))
                     Rows Removed by Filter: 162390
               ->  Parallel Hash  (cost=119080.39..119080.39 rows=123 width=60) (actual time=307.693..307.694 rows=364 loops=3)
                     Buckets: 1024  Batches: 1  Memory Usage: 168kB
                     ->  Parallel Index Scan using xif11sep_info_report_extract on sep_info_report_extract sire2  (cost=0.56..119080.39 rows=123 width=60) (actual time=1.656..307.415 rows=364 loops=3)
                           Index Cond: ((reqt_processing_completed_dts >= '2022-06-27 00:00:00'::timestamp without time zone) AND (reqt_processing_completed_dts <= '2022-08-31 23:59:59'::timestamp without time zone))
                           Filter: ((rest_processing_completed_dts IS NOT NULL) AND ((reqt_failed_ind)::text <> '1'::text) AND ((reqxt_failed_ind IS NULL) OR ((reqxt_failed_ind)::text <> '1'::text)) AND ((rest_failed_ind)::text <> '1'::text) AND ((reqtde_organization_type)::text <> 'SEW_EMPLOYER'::text) AND (req_valid_ind = '1'::numeric) AND (res_valid_ind = '1'::numeric) AND (reqte_endpoint_id = '1'::numeric(38,0)) AND (reqtde_endpoint_id = '507650'::numeric(38,0)))
                           Rows Removed by Filter: 358336
 Planning Time: 0.966 ms
 Execution Time: 458.026 ms
(20 rows)

