Hello, can you tell me how to optimize this sql request with this query plan? Unique  (cost=27698119.66..27701410.51 rows=73130 width=432)
  CTE siteinfo
    ->  HashAggregate  (cost=146.47..146.57 rows=10 width=168)
          Group Key: site.id, "sitesTranscos"."siteId", "sitesTranscos"."transcoSiteId", siteparent.id, site."resultCenter", site."fundingFlowEnabled"
          ->  Append  (cost=37.53..146.32 rows=10 width=168)
                ->  Nested Loop Left Join  (cost=37.53..59.54 rows=1 width=33)
                      Filter: ((siteparent.id IS NULL) OR (siteparent."fundingFlowEnabled" < now()))
                      ->  Nested Loop Left Join  (cost=37.25..59.21 rows=1 width=33)
                            ->  Nested Loop  (cost=37.10..41.65 rows=1 width=28)
                                  ->  Hash Right Join  (cost=36.95..39.47 rows=1 width=35)
                                        Hash Cond: (("sitesTranscos"."siteId")::text = (site.id)::text)
                                        Filter: ("sitesTranscos"."ucId" IS NULL)
                                        ->  Seq Scan on "SitesTransco" "sitesTranscos"  (cost=0.00..2.10 rows=110 width=17)
                                        ->  Hash  (cost=36.76..36.76 rows=15 width=25)
                                              ->  Seq Scan on "Sites" site  (cost=0.00..36.76 rows=15 width=25)
                                                    Filter: (("ucId")::text = 'FRC346A'::text)
                                  ->  Index Only Scan using "PK_7c226b1c88109206013a593bae8" on "Ucs" uc  (cost=0.15..2.16 rows=1 width=5)
                                        Index Cond: (id = 'FRC346A'::text)
                            ->  Index Only Scan using "PK_fe2437d4a0ae2967b5f484eda28" on sites_children__sites siteparent_site  (cost=0.15..17.55 rows=1 width=10)
                                  Index Cond: ("childSiteId" = (site.id)::text)
                      ->  Index Scan using "PK_6f068cb0d436875b1263bdbb58d" on "Sites" siteparent  (cost=0.28..0.32 rows=1 width=13)
                            Index Cond: ((id)::text = (siteparent_site."parentSiteId")::text)
                ->  Nested Loop  (cost=41.24..86.68 rows=9 width=33)
                      ->  Nested Loop Left Join  (cost=41.10..85.08 rows=9 width=40)
                            Filter: ((siteparent_1.id IS NULL) OR (siteparent_1."fundingFlowEnabled" < now()))
                            ->  Hash Right Join  (cost=40.82..80.38 rows=14 width=40)
                                  Hash Cond: ((siteparent_site_1."childSiteId")::text = (site_1.id)::text)
                                  ->  Seq Scan on sites_children__sites siteparent_site_1  (cost=0.00..31.40 rows=2140 width=10)
                                  ->  Hash  (cost=40.64..40.64 rows=14 width=35)
                                        ->  Nested Loop  (cost=0.28..40.64 rows=14 width=35)
                                              ->  Seq Scan on "SitesTransco" "sitesTranscos_1"  (cost=0.00..2.38 rows=14 width=10)
                                                    Filter: (("ucId")::text = 'FRC346A'::text)
                                              ->  Index Scan using "PK_6f068cb0d436875b1263bdbb58d" on "Sites" site_1  (cost=0.28..2.72 rows=1 width=25)
                                                    Index Cond: ((id)::text = ("sitesTranscos_1"."siteId")::text)
                            ->  Index Scan using "PK_6f068cb0d436875b1263bdbb58d" on "Sites" siteparent_1  (cost=0.28..0.32 rows=1 width=13)
                                  Index Cond: ((id)::text = (siteparent_site_1."parentSiteId")::text)
                      ->  Index Only Scan using "PK_7c226b1c88109206013a593bae8" on "Ucs" uc_1  (cost=0.15..0.17 rows=1 width=5)
                            Index Cond: (id = (site_1."ucId")::text)
  ->  Sort  (cost=27697973.09..27698155.91 rows=73130 width=432)
        Sort Key: af.id, af."amountValue", f."paymentDate", af.fee, af."paymentDate", f."fundingDate", af."paymentModeId", f.origin, f."transferId", f."commercialContract", af."entityType", (COALESCE((SubPlan 3), ''::character varying)), f."recordType", (NULL::timestamp with time zone), (NULL::text), (CASE WHEN (siteinfo."sitesTranscos_siteId" IS NOT NULL) THEN siteinfo."sitesTranscos_transcoSiteId" WHEN (siteinfo.siteparent_id IS NOT NULL) THEN siteinfo.siteparent_id ELSE af."siteId" END), siteinfo."site_resultCenter"
        ->  Hash Join  (cost=27442508.89..27692064.85 rows=73130 width=432)
              Hash Cond: ((af."siteId")::text = (siteinfo.site_id)::text)
              Join Filter: (f."fundingDate" > siteinfo."site_fundingFlowEnabled")
              ->  Unique  (cost=27442508.57..27628989.94 rows=4387797 width=884)
                    ->  Sort  (cost=27442508.57..27453478.06 rows=4387797 width=884)
                          Sort Key: af.id, af."amountValue", af."paymentDate", af."paymentModeId", af.fee, af."entityType", (COALESCE((SubPlan 3), ''::character varying)), f."paymentDate", f."fundingDate", f.origin, f."transferId", f."commercialContract", f."recordType", af."siteId", (NULL::timestamp with time zone), (NULL::text)
                          ->  Append  (cost=6558403.12..25737208.43 rows=4387797 width=884)
                                ->  Hash Right Join  (cost=6558403.12..24311513.75 rows=4387769 width=195)
                                      Hash Cond: (oaf."assignedFundingsId" = af.id)
                                      Filter: (((oaf."assignedFundingsId" IS NULL) AND (af."outdatedDate" IS NULL) AND ((((f."recordType")::text <> 'CHARGEBACK'::text) AND ((f."recordType")::text <> 'CHARGEBACK_REVERSAL'::text)) OR (f."recordType" IS NULL)) AND ((f."paymentModeId")::text = ANY ('{LYFPAY,AMEX,CB,CA,PNF,PNFCB,PP,VIR}'::text[])) AND (af."entityType" <> 'HIPAY'::text)) OR (af."entityType" IS NULL))
                                      ->  Seq Scan on operations_assigned_fundings__assigned_fundings oaf  (cost=0.00..600420.82 rows=31099282 width=16)
                                      ->  Hash  (cost=5685605.30..5685605.30 rows=24286545 width=167)
                                            ->  Hash Join  (cost=1918636.22..5685605.30 rows=24286545 width=167)
                                                  Hash Cond: (af."fundingId" = f.id)
                                                  ->  Seq Scan on "AssignedFundings" af  (cost=0.00..1004563.56 rows=35750556 width=74)
                                                  ->  Hash  (cost=1165617.40..1165617.40 rows=24248146 width=125)
                                                        ->  Seq Scan on "Fundings" f  (cost=0.00..1165617.40 rows=24248146 width=125)
                                                              Filter: ((origin)::text <> 'INTERNAL'::text)
                                      SubPlan 3
                                        ->  Seq Scan on paymentmode_psp_entityid ppe_1  (cost=0.00..3.35 rows=1 width=9)
                                              Filter: ((entity_id = (f."entityId")::text) AND ((psp_id)::text = (f.origin)::text) AND ((paymentmode_id)::text = (f."paymentModeId")::text))
                                ->  Subquery Scan on "*SELECT* 2"  (cost=1141739.76..1381816.99 rows=28 width=192)
                                      ->  Nested Loop  (cost=1141739.76..1381816.64 rows=28 width=192)
                                            ->  Hash Left Join  (cost=1141739.20..1381441.70 rows=61 width=103)
                                                  Hash Cond: (aww."ctmWithdrawalId" = w.id)
                                                  Filter: ((w."ctmStatusId" = 'confirmed'::text) OR (w."ctmStatusId" IS NULL))
                                                  ->  Nested Loop Left Join  (cost=1141698.12..1381398.97 rows=102 width=89)
                                                        ->  Hash Anti Join  (cost=1141697.71..1381159.94 rows=102 width=66)
                                                              Hash Cond: (af_1.id = oaf_1."assignedFundingsId")
                                                              ->  Bitmap Heap Scan on "AssignedFundings" af_1  (cost=683.86..88193.18 rows=163 width=66)
                                                                    Recheck Cond: ("ctmStatusId" = 'withdrawal confirmed'::text)
                                                                    Filter: (("outdatedDate" IS NULL) AND ("entityType" = 'HIPAY'::text))
                                                                    ->  Bitmap Index Scan on "IDX_AF_ctmStatusId"  (cost=0.00..683.82 rows=52434 width=0)
                                                                          Index Cond: ("ctmStatusId" = 'withdrawal confirmed'::text)
                                                              ->  Hash  (cost=600420.82..600420.82 rows=31099282 width=16)
                                                                    ->  Seq Scan on operations_assigned_fundings__assigned_fundings oaf_1  (cost=0.00..600420.82 rows=31099282 width=16)
                                                        ->  Index Only Scan using "PK_69886f46bf9fed5921332af0520" on "assignedFundings_CTMWithdrawals__CTMWithdrawals" aww  (cost=0.42..2.30 rows=4 width=39)
                                                              Index Cond: ("assignedFundingId" = af_1.id)
                                                  ->  Hash  (cost=28.81..28.81 rows=981 width=68)
                                                        ->  Seq Scan on "CTM_Withdrawals" w  (cost=0.00..28.81 rows=981 width=68)
                                            ->  Index Scan using "PK_b31a7a9f6cd5660ce7b85ada52e" on "Fundings" f_1  (cost=0.56..4.60 rows=1 width=125)
                                                  Index Cond: (id = af_1."fundingId")
                                                  Filter: (((origin)::text <> 'INTERNAL'::text) AND (((("recordType")::text <> 'CHARGEBACK'::text) AND (("recordType")::text <> 'CHARGEBACK_REVERSAL'::text)) OR ("recordType" IS NULL)) AND (("paymentModeId")::text = ANY ('{LYFPAY,AMEX,CB,CA,PNF,PNFCB,PP,VIR}'::text[])))
                                            SubPlan 2
                                              ->  Seq Scan on paymentmode_psp_entityid ppe  (cost=0.00..3.35 rows=1 width=9)
                                                    Filter: ((entity_id = (f_1."entityId")::text) AND ((psp_id)::text = (f_1.origin)::text) AND ((paymentmode_id)::text = (f_1."paymentModeId")::text))
              ->  Hash  (cost=0.20..0.20 rows=10 width=168)
                    ->  CTE Scan on siteinfo  (cost=0.00..0.20 rows=10 width=168)