Giter Club home page Giter Club logo

Comments (6)

laurenz avatar laurenz commented on August 14, 2024

This should work.

Can I see the output of EXPLAIN (VERBOSE) for the problematic query?

from oracle_fdw.

ckinsey avatar ckinsey commented on August 14, 2024

Here's the EXPLAIN VERBOSE of the actual query. It's pretty gnarly because the tables are wide and we are having to join the same table 3 times:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  QUERY PLAN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Merge Right Join  (cost=45263.82..47616.32 rows=125000 width=11714)
   Output: a.business_unit, a.deal_id, a.lob, a.deal_type, a.lead_deptid, a.deal_status, a.office_deal, a.version_num, a.dont_send_vol_flg, a.is_confidential, a.currency_cd, a.associated_deal_id, a.is_dual_rep_deal, a.is_dispropor_deal, a.on_hold, a.on_hold_reason, a.on_hold_date, a.on_hold_by, a.is_referral_deal, a.opportunity_num, a.officename, a.cbre_rep_client, a.storage_comp_info, a.lead_broker, a.conversion_code, a.is_converted_deal, a.deal_live_flg, a.deal_live_date, a.orig_deal_num, a.entry_dt, a.business_unit_pc, a.project_id, a.activity_id, a.completed_date, a.deal_user_status, a.submitted_by, a.submitted_dttm, a.approval_status, a.approved_by, a.approvedttm, a.last_approved_by, a.last_approvedttm, a.pc_distrib_status, a.process_instance, a.post_status, a.in_process_flg, a.tot_budject, a.comm_agmnt_type, a.pct_amt_1, a.pct_amt_2, a.pct_amt_3, a.pct_amt_4, a.pct_amt_5, a.tot_cons, a.tot_comm, a.cancel_reason, a.created_by, a.created_dttm, a.last_update_by, a.last_update_dttm, a.syncid, a.syncdttm, a.project_num, a.cb_affiliate_refer, a.cb_affiliat_office, a.source_by, a.source_officename, a.descrlong, a.cb_rel_to_oth_deal, a.cb_related_deal_id, b.business_unit, b.deal_id, b.relationtype, b.relationship_id, b.active_flag, b.primary_flag, b.cust_id, b.address_seq_num, b.cust_source_id, b.refer_to_cust_id, b.bill_to_clnt, b.bus_use_id, b.naics_id, b.location_id, b.alt_cust_name, b.corporate_setid, b.corporate_cust_id, b.contact_id, b.cntct_seq_num, b.is_conf_cust, b.contact_name, b.contact_title, b.contact_phone, b.contact_email, b.purchaser_type, b.investor_type, b.investor_lndr_type, b.tenant_crdt_rating, b.property_id, b.mix_propid, b.space_type, b.ownership_type, b.property_status, b.propertyname, b.suite_num, b.parcel_size, b.parcel_size_uom, b.area_leased_sold, b.area_uom, b.managed_prop, b.portfolio_name, b.is_conf_prop, b.is_listed_by_cb, b.development_prop, b.tcc_di_prop, b.sale_lease_back, b.units_num, b.tenants_num, b.net_rentable_area, b.project_id, b.property_type, b.prop_sub_type, b.building_class, b.investment_prop, b.expiration_date, b.lease_type, b.lease_income_type, b.lease_exec_dt, b.est_occupancy_dt, b.sublease_flg, b.lease_from_dt, b.lease_to_dt, b.lease_concession, b.annual_rent, b.retl_tenant_typ_id, b.annual_rent_uom, b.est_close_dt, b.sch_gross_income, b.vaccancy_pct, b.property_expense, b.net_oprtng_income, b.cap_rate_yield, b.spendable_retn, b.occupancy_pct, b.exchange_flg, b.created_by, b.created_dttm, b.last_update_by, b.last_update_dttm, b.syncid, b.syncdttm, b.cb_floor_num, b.cb_prior_address1, b.cb_prior_address2, b.cb_prior_address3, b.cb_prior_address4, b.cb_prior_city, b.cb_prior_country, b.cb_prior_postal, b.cb_prior_state, b.cb_prior_county, b.cb_prior_rent_sft, b.cb_tnt_impr_amt, b.cb_tnt_pay_comm, b.cb_free_rent, b.cb_othr_concess, b.cb_no_seats, c.business_unit, c.deal_id, c.relationtype, c.relationship_id, c.active_flag, c.primary_flag, c.cust_id, c.address_seq_num, c.cust_source_id, c.refer_to_cust_id, c.bill_to_clnt, c.bus_use_id, c.naics_id, c.location_id, c.alt_cust_name, c.corporate_setid, c.corporate_cust_id, c.contact_id, c.cntct_seq_num, c.is_conf_cust, c.contact_name, c.contact_title, c.contact_phone, c.contact_email, c.purchaser_type, c.investor_type, c.investor_lndr_type, c.tenant_crdt_rating, c.property_id, c.mix_propid, c.space_type, c.ownership_type, c.property_status, c.propertyname, c.suite_num, c.parcel_size, c.parcel_size_uom, c.area_leased_sold, c.area_uom, c.managed_prop, c.portfolio_name, c.is_conf_prop, c.is_listed_by_cb, c.development_prop, c.tcc_di_prop, c.sale_lease_back, c.units_num, c.tenants_num, c.net_rentable_area, c.project_id, c.property_type, c.prop_sub_type, c.building_class, c.investment_prop, c.expiration_date, c.lease_type, c.lease_income_type, c.lease_exec_dt, c.est_occupancy_dt, c.sublease_flg, c.lease_from_dt, c.lease_to_dt, c.lease_concession, c.annual_rent, c.retl_tenant_typ_id, c.annual_rent_uom, c.est_close_dt, c.sch_gross_income, c.vaccancy_pct, c.property_expense, c.net_oprtng_income, c.cap_rate_yield, c.spendable_retn, c.occupancy_pct, c.exchange_flg, c.created_by, c.created_dttm, c.last_update_by, c.last_update_dttm, c.syncid, c.syncdttm, c.cb_floor_num, c.cb_prior_address1, c.cb_prior_address2, c.cb_prior_address3, c.cb_prior_address4, c.cb_prior_city, c.cb_prior_country, c.cb_prior_postal, c.cb_prior_state, c.cb_prior_county, c.cb_prior_rent_sft, c.cb_tnt_impr_amt, c.cb_tnt_pay_comm, c.cb_free_rent, c.cb_othr_concess, c.cb_no_seats, d.business_unit, d.deal_id, d.relationtype, d.relationship_id, d.active_flag, d.primary_flag, d.cust_id, d.address_seq_num, d.cust_source_id, d.refer_to_cust_id, d.bill_to_clnt, d.bus_use_id, d.naics_id, d.location_id, d.alt_cust_name, d.corporate_setid, d.corporate_cust_id, d.contact_id, d.cntct_seq_num, d.is_conf_cust, d.contact_name, d.contact_title, d.contact_phone, d.contact_email, d.purchaser_type, d.investor_type, d.investor_lndr_type, d.tenant_crdt_rating, d.property_id, d.mix_propid, d.space_type, d.ownership_type, d.property_status, d.propertyname, d.suite_num, d.parcel_size, d.parcel_size_uom, d.area_leased_sold, d.area_uom, d.managed_prop, d.portfolio_name, d.is_conf_prop, d.is_listed_by_cb, d.development_prop, d.tcc_di_prop, d.sale_lease_back, d.units_num, d.tenants_num, d.net_rentable_area, d.project_id, d.property_type, d.prop_sub_type, d.building_class, d.investment_prop, d.expiration_date, d.lease_type, d.lease_income_type, d.lease_exec_dt, d.est_occupancy_dt, d.sublease_flg, d.lease_from_dt, d.lease_to_dt, d.lease_concession, d.annual_rent, d.retl_tenant_typ_id, d.annual_rent_uom, d.est_close_dt, d.sch_gross_income, d.vaccancy_pct, d.property_expense, d.net_oprtng_income, d.cap_rate_yield, d.spendable_retn, d.occupancy_pct, d.exchange_flg, d.created_by, d.created_dttm, d.last_update_by, d.last_update_dttm, d.syncid, d.syncdttm, d.cb_floor_num, d.cb_prior_address1, d.cb_prior_address2, d.cb_prior_address3, d.cb_prior_address4, d.cb_prior_city, d.cb_prior_country, d.cb_prior_postal, d.cb_prior_state, d.cb_prior_county, d.cb_prior_rent_sft, d.cb_tnt_impr_amt, d.cb_tnt_pay_comm, d.cb_free_rent, d.cb_othr_concess, d.cb_no_seats, 'ready'
   Merge Cond: ((d.deal_id)::text = (a.deal_id)::text)
   ->  Sort  (cost=11456.83..11459.33 rows=1000 width=3258)
         Output: d.business_unit, d.deal_id, d.relationtype, d.relationship_id, d.active_flag, d.primary_flag, d.cust_id, d.address_seq_num, d.cust_source_id, d.refer_to_cust_id, d.bill_to_clnt, d.bus_use_id, d.naics_id, d.location_id, d.alt_cust_name, d.corporate_setid, d.corporate_cust_id, d.contact_id, d.cntct_seq_num, d.is_conf_cust, d.contact_name, d.contact_title, d.contact_phone, d.contact_email, d.purchaser_type, d.investor_type, d.investor_lndr_type, d.tenant_crdt_rating, d.property_id, d.mix_propid, d.space_type, d.ownership_type, d.property_status, d.propertyname, d.suite_num, d.parcel_size, d.parcel_size_uom, d.area_leased_sold, d.area_uom, d.managed_prop, d.portfolio_name, d.is_conf_prop, d.is_listed_by_cb, d.development_prop, d.tcc_di_prop, d.sale_lease_back, d.units_num, d.tenants_num, d.net_rentable_area, d.project_id, d.property_type, d.prop_sub_type, d.building_class, d.investment_prop, d.expiration_date, d.lease_type, d.lease_income_type, d.lease_exec_dt, d.est_occupancy_dt, d.sublease_flg, d.lease_from_dt, d.lease_to_dt, d.lease_concession, d.annual_rent, d.retl_tenant_typ_id, d.annual_rent_uom, d.est_close_dt, d.sch_gross_income, d.vaccancy_pct, d.property_expense, d.net_oprtng_income, d.cap_rate_yield, d.spendable_retn, d.occupancy_pct, d.exchange_flg, d.created_by, d.created_dttm, d.last_update_by, d.last_update_dttm, d.syncid, d.syncdttm, d.cb_floor_num, d.cb_prior_address1, d.cb_prior_address2, d.cb_prior_address3, d.cb_prior_address4, d.cb_prior_city, d.cb_prior_country, d.cb_prior_postal, d.cb_prior_state, d.cb_prior_county, d.cb_prior_rent_sft, d.cb_tnt_impr_amt, d.cb_tnt_pay_comm, d.cb_free_rent, d.cb_othr_concess, d.cb_no_seats
         Sort Key: d.deal_id
         ->  Foreign Scan on public.ps_cbta_deal_rel d  (cost=10000.00..10000.00 rows=1000 width=3258)
               Output: d.business_unit, d.deal_id, d.relationtype, d.relationship_id, d.active_flag, d.primary_flag, d.cust_id, d.address_seq_num, d.cust_source_id, d.refer_to_cust_id, d.bill_to_clnt, d.bus_use_id, d.naics_id, d.location_id, d.alt_cust_name, d.corporate_setid, d.corporate_cust_id, d.contact_id, d.cntct_seq_num, d.is_conf_cust, d.contact_name, d.contact_title, d.contact_phone, d.contact_email, d.purchaser_type, d.investor_type, d.investor_lndr_type, d.tenant_crdt_rating, d.property_id, d.mix_propid, d.space_type, d.ownership_type, d.property_status, d.propertyname, d.suite_num, d.parcel_size, d.parcel_size_uom, d.area_leased_sold, d.area_uom, d.managed_prop, d.portfolio_name, d.is_conf_prop, d.is_listed_by_cb, d.development_prop, d.tcc_di_prop, d.sale_lease_back, d.units_num, d.tenants_num, d.net_rentable_area, d.project_id, d.property_type, d.prop_sub_type, d.building_class, d.investment_prop, d.expiration_date, d.lease_type, d.lease_income_type, d.lease_exec_dt, d.est_occupancy_dt, d.sublease_flg, d.lease_from_dt, d.lease_to_dt, d.lease_concession, d.annual_rent, d.retl_tenant_typ_id, d.annual_rent_uom, d.est_close_dt, d.sch_gross_income, d.vaccancy_pct, d.property_expense, d.net_oprtng_income, d.cap_rate_yield, d.spendable_retn, d.occupancy_pct, d.exchange_flg, d.created_by, d.created_dttm, d.last_update_by, d.last_update_dttm, d.syncid, d.syncdttm, d.cb_floor_num, d.cb_prior_address1, d.cb_prior_address2, d.cb_prior_address3, d.cb_prior_address4, d.cb_prior_city, d.cb_prior_country, d.cb_prior_postal, d.cb_prior_state, d.cb_prior_county, d.cb_prior_rent_sft, d.cb_tnt_impr_amt, d.cb_tnt_pay_comm, d.cb_free_rent, d.cb_othr_concess, d.cb_no_seats
               Oracle query: SELECT /*7de909a4605a32f18198212edb675c18*/ "BUSINESS_UNIT", "DEAL_ID", "RELATIONTYPE", "RELATIONSHIP_ID", "ACTIVE_FLAG", "PRIMARY_FLAG", "CUST_ID", "ADDRESS_SEQ_NUM", "CUST_SOURCE_ID", "REFER_TO_CUST_ID", "BILL_TO_CLNT", "BUS_USE_ID", "NAICS_ID", "LOCATION_ID", "ALT_CUST_NAME", "CORPORATE_SETID", "CORPORATE_CUST_ID", "CONTACT_ID", "CNTCT_SEQ_NUM", "IS_CONF_CUST", "CONTACT_NAME", "CONTACT_TITLE", "CONTACT_PHONE", "CONTACT_EMAIL", "PURCHASER_TYPE", "INVESTOR_TYPE", "INVESTOR_LNDR_TYPE", "TENANT_CRDT_RATING", "PROPERTY_ID", "MIX_PROPID", "SPACE_TYPE", "OWNERSHIP_TYPE", "PROPERTY_STATUS", "PROPERTYNAME", "SUITE_NUM", "PARCEL_SIZE", "PARCEL_SIZE_UOM", "AREA_LEASED_SOLD", "AREA_UOM", "MANAGED_PROP", "PORTFOLIO_NAME", "IS_CONF_PROP", "IS_LISTED_BY_CB", "DEVELOPMENT_PROP", "TCC_DI_PROP", "SALE_LEASE_BACK", "UNITS_NUM", "TENANTS_NUM", "NET_RENTABLE_AREA", "PROJECT_ID", "PROPERTY_TYPE", "PROP_SUB_TYPE", "BUILDING_CLASS", "INVESTMENT_PROP", "EXPIRATION_DATE", "LEASE_TYPE", "LEASE_INCOME_TYPE", "LEASE_EXEC_DT", "EST_OCCUPANCY_DT", "SUBLEASE_FLG", "LEASE_FROM_DT", "LEASE_TO_DT", "LEASE_CONCESSION", "ANNUAL_RENT", "RETL_TENANT_TYP_ID", "ANNUAL_RENT_UOM", "EST_CLOSE_DT", "SCH_GROSS_INCOME", "VACCANCY_PCT", "PROPERTY_EXPENSE", "NET_OPRTNG_INCOME", "CAP_RATE_YIELD", "SPENDABLE_RETN", "OCCUPANCY_PCT", "EXCHANGE_FLG", "CREATED_BY", "CREATED_DTTM", "LAST_UPDATE_BY", "LAST_UPDATE_DTTM", "SYNCID", "SYNCDTTM", "CB_FLOOR_NUM", "CB_PRIOR_ADDRESS1", "CB_PRIOR_ADDRESS2", "CB_PRIOR_ADDRESS3", "CB_PRIOR_ADDRESS4", "CB_PRIOR_CITY", "CB_PRIOR_COUNTRY", "CB_PRIOR_POSTAL", "CB_PRIOR_STATE", "CB_PRIOR_COUNTY", "CB_PRIOR_RENT_SFT", "CB_TNT_IMPR_AMT", "CB_TNT_PAY_COMM", "CB_FREE_RENT", "CB_OTHR_CONCESS", "CB_NO_SEATS" FROM "SYSADM"."PS_CBTA_DEAL_REL" WHERE ("RELATIONTYPE" = 'SALE')
               Oracle plan: SELECT STATEMENT
               Oracle plan:   TABLE ACCESS STORAGE FULL PS_CBTA_DEAL_REL (condition "RELATIONTYPE"='SALE') (filter "RELATIONTYPE"='SALE')
   ->  Materialize  (cost=33806.99..34341.99 rows=25000 width=8456)
         Output: a.business_unit, a.deal_id, a.lob, a.deal_type, a.lead_deptid, a.deal_status, a.office_deal, a.version_num, a.dont_send_vol_flg, a.is_confidential, a.currency_cd, a.associated_deal_id, a.is_dual_rep_deal, a.is_dispropor_deal, a.on_hold, a.on_hold_reason, a.on_hold_date, a.on_hold_by, a.is_referral_deal, a.opportunity_num, a.officename, a.cbre_rep_client, a.storage_comp_info, a.lead_broker, a.conversion_code, a.is_converted_deal, a.deal_live_flg, a.deal_live_date, a.orig_deal_num, a.entry_dt, a.business_unit_pc, a.project_id, a.activity_id, a.completed_date, a.deal_user_status, a.submitted_by, a.submitted_dttm, a.approval_status, a.approved_by, a.approvedttm, a.last_approved_by, a.last_approvedttm, a.pc_distrib_status, a.process_instance, a.post_status, a.in_process_flg, a.tot_budject, a.comm_agmnt_type, a.pct_amt_1, a.pct_amt_2, a.pct_amt_3, a.pct_amt_4, a.pct_amt_5, a.tot_cons, a.tot_comm, a.cancel_reason, a.created_by, a.created_dttm, a.last_update_by, a.last_update_dttm, a.syncid, a.syncdttm, a.project_num, a.cb_affiliate_refer, a.cb_affiliat_office, a.source_by, a.source_officename, a.descrlong, a.cb_rel_to_oth_deal, a.cb_related_deal_id, b.business_unit, b.deal_id, b.relationtype, b.relationship_id, b.active_flag, b.primary_flag, b.cust_id, b.address_seq_num, b.cust_source_id, b.refer_to_cust_id, b.bill_to_clnt, b.bus_use_id, b.naics_id, b.location_id, b.alt_cust_name, b.corporate_setid, b.corporate_cust_id, b.contact_id, b.cntct_seq_num, b.is_conf_cust, b.contact_name, b.contact_title, b.contact_phone, b.contact_email, b.purchaser_type, b.investor_type, b.investor_lndr_type, b.tenant_crdt_rating, b.property_id, b.mix_propid, b.space_type, b.ownership_type, b.property_status, b.propertyname, b.suite_num, b.parcel_size, b.parcel_size_uom, b.area_leased_sold, b.area_uom, b.managed_prop, b.portfolio_name, b.is_conf_prop, b.is_listed_by_cb, b.development_prop, b.tcc_di_prop, b.sale_lease_back, b.units_num, b.tenants_num, b.net_rentable_area, b.project_id, b.property_type, b.prop_sub_type, b.building_class, b.investment_prop, b.expiration_date, b.lease_type, b.lease_income_type, b.lease_exec_dt, b.est_occupancy_dt, b.sublease_flg, b.lease_from_dt, b.lease_to_dt, b.lease_concession, b.annual_rent, b.retl_tenant_typ_id, b.annual_rent_uom, b.est_close_dt, b.sch_gross_income, b.vaccancy_pct, b.property_expense, b.net_oprtng_income, b.cap_rate_yield, b.spendable_retn, b.occupancy_pct, b.exchange_flg, b.created_by, b.created_dttm, b.last_update_by, b.last_update_dttm, b.syncid, b.syncdttm, b.cb_floor_num, b.cb_prior_address1, b.cb_prior_address2, b.cb_prior_address3, b.cb_prior_address4, b.cb_prior_city, b.cb_prior_country, b.cb_prior_postal, b.cb_prior_state, b.cb_prior_county, b.cb_prior_rent_sft, b.cb_tnt_impr_amt, b.cb_tnt_pay_comm, b.cb_free_rent, b.cb_othr_concess, b.cb_no_seats, c.business_unit, c.deal_id, c.relationtype, c.relationship_id, c.active_flag, c.primary_flag, c.cust_id, c.address_seq_num, c.cust_source_id, c.refer_to_cust_id, c.bill_to_clnt, c.bus_use_id, c.naics_id, c.location_id, c.alt_cust_name, c.corporate_setid, c.corporate_cust_id, c.contact_id, c.cntct_seq_num, c.is_conf_cust, c.contact_name, c.contact_title, c.contact_phone, c.contact_email, c.purchaser_type, c.investor_type, c.investor_lndr_type, c.tenant_crdt_rating, c.property_id, c.mix_propid, c.space_type, c.ownership_type, c.property_status, c.propertyname, c.suite_num, c.parcel_size, c.parcel_size_uom, c.area_leased_sold, c.area_uom, c.managed_prop, c.portfolio_name, c.is_conf_prop, c.is_listed_by_cb, c.development_prop, c.tcc_di_prop, c.sale_lease_back, c.units_num, c.tenants_num, c.net_rentable_area, c.project_id, c.property_type, c.prop_sub_type, c.building_class, c.investment_prop, c.expiration_date, c.lease_type, c.lease_income_type, c.lease_exec_dt, c.est_occupancy_dt, c.sublease_flg, c.lease_from_dt, c.lease_to_dt, c.lease_concession, c.annual_rent, c.retl_tenant_typ_id, c.annual_rent_uom, c.est_close_dt, c.sch_gross_income, c.vaccancy_pct, c.property_expense, c.net_oprtng_income, c.cap_rate_yield, c.spendable_retn, c.occupancy_pct, c.exchange_flg, c.created_by, c.created_dttm, c.last_update_by, c.last_update_dttm, c.syncid, c.syncdttm, c.cb_floor_num, c.cb_prior_address1, c.cb_prior_address2, c.cb_prior_address3, c.cb_prior_address4, c.cb_prior_city, c.cb_prior_country, c.cb_prior_postal, c.cb_prior_state, c.cb_prior_county, c.cb_prior_rent_sft, c.cb_tnt_impr_amt, c.cb_tnt_pay_comm, c.cb_free_rent, c.cb_othr_concess, c.cb_no_seats
         ->  Merge Left Join  (cost=33806.99..34279.49 rows=25000 width=8456)
               Output: a.business_unit, a.deal_id, a.lob, a.deal_type, a.lead_deptid, a.deal_status, a.office_deal, a.version_num, a.dont_send_vol_flg, a.is_confidential, a.currency_cd, a.associated_deal_id, a.is_dual_rep_deal, a.is_dispropor_deal, a.on_hold, a.on_hold_reason, a.on_hold_date, a.on_hold_by, a.is_referral_deal, a.opportunity_num, a.officename, a.cbre_rep_client, a.storage_comp_info, a.lead_broker, a.conversion_code, a.is_converted_deal, a.deal_live_flg, a.deal_live_date, a.orig_deal_num, a.entry_dt, a.business_unit_pc, a.project_id, a.activity_id, a.completed_date, a.deal_user_status, a.submitted_by, a.submitted_dttm, a.approval_status, a.approved_by, a.approvedttm, a.last_approved_by, a.last_approvedttm, a.pc_distrib_status, a.process_instance, a.post_status, a.in_process_flg, a.tot_budject, a.comm_agmnt_type, a.pct_amt_1, a.pct_amt_2, a.pct_amt_3, a.pct_amt_4, a.pct_amt_5, a.tot_cons, a.tot_comm, a.cancel_reason, a.created_by, a.created_dttm, a.last_update_by, a.last_update_dttm, a.syncid, a.syncdttm, a.project_num, a.cb_affiliate_refer, a.cb_affiliat_office, a.source_by, a.source_officename, a.descrlong, a.cb_rel_to_oth_deal, a.cb_related_deal_id, b.business_unit, b.deal_id, b.relationtype, b.relationship_id, b.active_flag, b.primary_flag, b.cust_id, b.address_seq_num, b.cust_source_id, b.refer_to_cust_id, b.bill_to_clnt, b.bus_use_id, b.naics_id, b.location_id, b.alt_cust_name, b.corporate_setid, b.corporate_cust_id, b.contact_id, b.cntct_seq_num, b.is_conf_cust, b.contact_name, b.contact_title, b.contact_phone, b.contact_email, b.purchaser_type, b.investor_type, b.investor_lndr_type, b.tenant_crdt_rating, b.property_id, b.mix_propid, b.space_type, b.ownership_type, b.property_status, b.propertyname, b.suite_num, b.parcel_size, b.parcel_size_uom, b.area_leased_sold, b.area_uom, b.managed_prop, b.portfolio_name, b.is_conf_prop, b.is_listed_by_cb, b.development_prop, b.tcc_di_prop, b.sale_lease_back, b.units_num, b.tenants_num, b.net_rentable_area, b.project_id, b.property_type, b.prop_sub_type, b.building_class, b.investment_prop, b.expiration_date, b.lease_type, b.lease_income_type, b.lease_exec_dt, b.est_occupancy_dt, b.sublease_flg, b.lease_from_dt, b.lease_to_dt, b.lease_concession, b.annual_rent, b.retl_tenant_typ_id, b.annual_rent_uom, b.est_close_dt, b.sch_gross_income, b.vaccancy_pct, b.property_expense, b.net_oprtng_income, b.cap_rate_yield, b.spendable_retn, b.occupancy_pct, b.exchange_flg, b.created_by, b.created_dttm, b.last_update_by, b.last_update_dttm, b.syncid, b.syncdttm, b.cb_floor_num, b.cb_prior_address1, b.cb_prior_address2, b.cb_prior_address3, b.cb_prior_address4, b.cb_prior_city, b.cb_prior_country, b.cb_prior_postal, b.cb_prior_state, b.cb_prior_county, b.cb_prior_rent_sft, b.cb_tnt_impr_amt, b.cb_tnt_pay_comm, b.cb_free_rent, b.cb_othr_concess, b.cb_no_seats, c.business_unit, c.deal_id, c.relationtype, c.relationship_id, c.active_flag, c.primary_flag, c.cust_id, c.address_seq_num, c.cust_source_id, c.refer_to_cust_id, c.bill_to_clnt, c.bus_use_id, c.naics_id, c.location_id, c.alt_cust_name, c.corporate_setid, c.corporate_cust_id, c.contact_id, c.cntct_seq_num, c.is_conf_cust, c.contact_name, c.contact_title, c.contact_phone, c.contact_email, c.purchaser_type, c.investor_type, c.investor_lndr_type, c.tenant_crdt_rating, c.property_id, c.mix_propid, c.space_type, c.ownership_type, c.property_status, c.propertyname, c.suite_num, c.parcel_size, c.parcel_size_uom, c.area_leased_sold, c.area_uom, c.managed_prop, c.portfolio_name, c.is_conf_prop, c.is_listed_by_cb, c.development_prop, c.tcc_di_prop, c.sale_lease_back, c.units_num, c.tenants_num, c.net_rentable_area, c.project_id, c.property_type, c.prop_sub_type, c.building_class, c.investment_prop, c.expiration_date, c.lease_type, c.lease_income_type, c.lease_exec_dt, c.est_occupancy_dt, c.sublease_flg, c.lease_from_dt, c.lease_to_dt, c.lease_concession, c.annual_rent, c.retl_tenant_typ_id, c.annual_rent_uom, c.est_close_dt, c.sch_gross_income, c.vaccancy_pct, c.property_expense, c.net_oprtng_income, c.cap_rate_yield, c.spendable_retn, c.occupancy_pct, c.exchange_flg, c.created_by, c.created_dttm, c.last_update_by, c.last_update_dttm, c.syncid, c.syncdttm, c.cb_floor_num, c.cb_prior_address1, c.cb_prior_address2, c.cb_prior_address3, c.cb_prior_address4, c.cb_prior_city, c.cb_prior_country, c.cb_prior_postal, c.cb_prior_state, c.cb_prior_county, c.cb_prior_rent_sft, c.cb_tnt_impr_amt, c.cb_tnt_pay_comm, c.cb_free_rent, c.cb_othr_concess, c.cb_no_seats
               Merge Cond: ((a.deal_id)::text = (c.deal_id)::text)
               ->  Merge Left Join  (cost=22350.16..22432.66 rows=5000 width=5198)
                     Output: a.business_unit, a.deal_id, a.lob, a.deal_type, a.lead_deptid, a.deal_status, a.office_deal, a.version_num, a.dont_send_vol_flg, a.is_confidential, a.currency_cd, a.associated_deal_id, a.is_dual_rep_deal, a.is_dispropor_deal, a.on_hold, a.on_hold_reason, a.on_hold_date, a.on_hold_by, a.is_referral_deal, a.opportunity_num, a.officename, a.cbre_rep_client, a.storage_comp_info, a.lead_broker, a.conversion_code, a.is_converted_deal, a.deal_live_flg, a.deal_live_date, a.orig_deal_num, a.entry_dt, a.business_unit_pc, a.project_id, a.activity_id, a.completed_date, a.deal_user_status, a.submitted_by, a.submitted_dttm, a.approval_status, a.approved_by, a.approvedttm, a.last_approved_by, a.last_approvedttm, a.pc_distrib_status, a.process_instance, a.post_status, a.in_process_flg, a.tot_budject, a.comm_agmnt_type, a.pct_amt_1, a.pct_amt_2, a.pct_amt_3, a.pct_amt_4, a.pct_amt_5, a.tot_cons, a.tot_comm, a.cancel_reason, a.created_by, a.created_dttm, a.last_update_by, a.last_update_dttm, a.syncid, a.syncdttm, a.project_num, a.cb_affiliate_refer, a.cb_affiliat_office, a.source_by, a.source_officename, a.descrlong, a.cb_rel_to_oth_deal, a.cb_related_deal_id, b.business_unit, b.deal_id, b.relationtype, b.relationship_id, b.active_flag, b.primary_flag, b.cust_id, b.address_seq_num, b.cust_source_id, b.refer_to_cust_id, b.bill_to_clnt, b.bus_use_id, b.naics_id, b.location_id, b.alt_cust_name, b.corporate_setid, b.corporate_cust_id, b.contact_id, b.cntct_seq_num, b.is_conf_cust, b.contact_name, b.contact_title, b.contact_phone, b.contact_email, b.purchaser_type, b.investor_type, b.investor_lndr_type, b.tenant_crdt_rating, b.property_id, b.mix_propid, b.space_type, b.ownership_type, b.property_status, b.propertyname, b.suite_num, b.parcel_size, b.parcel_size_uom, b.area_leased_sold, b.area_uom, b.managed_prop, b.portfolio_name, b.is_conf_prop, b.is_listed_by_cb, b.development_prop, b.tcc_di_prop, b.sale_lease_back, b.units_num, b.tenants_num, b.net_rentable_area, b.project_id, b.property_type, b.prop_sub_type, b.building_class, b.investment_prop, b.expiration_date, b.lease_type, b.lease_income_type, b.lease_exec_dt, b.est_occupancy_dt, b.sublease_flg, b.lease_from_dt, b.lease_to_dt, b.lease_concession, b.annual_rent, b.retl_tenant_typ_id, b.annual_rent_uom, b.est_close_dt, b.sch_gross_income, b.vaccancy_pct, b.property_expense, b.net_oprtng_income, b.cap_rate_yield, b.spendable_retn, b.occupancy_pct, b.exchange_flg, b.created_by, b.created_dttm, b.last_update_by, b.last_update_dttm, b.syncid, b.syncdttm, b.cb_floor_num, b.cb_prior_address1, b.cb_prior_address2, b.cb_prior_address3, b.cb_prior_address4, b.cb_prior_city, b.cb_prior_country, b.cb_prior_postal, b.cb_prior_state, b.cb_prior_county, b.cb_prior_rent_sft, b.cb_tnt_impr_amt, b.cb_tnt_pay_comm, b.cb_free_rent, b.cb_othr_concess, b.cb_no_seats
                     Merge Cond: ((a.deal_id)::text = (b.deal_id)::text)
                     ->  Sort  (cost=10893.33..10895.83 rows=1000 width=1940)
                           Output: a.business_unit, a.deal_id, a.lob, a.deal_type, a.lead_deptid, a.deal_status, a.office_deal, a.version_num, a.dont_send_vol_flg, a.is_confidential, a.currency_cd, a.associated_deal_id, a.is_dual_rep_deal, a.is_dispropor_deal, a.on_hold, a.on_hold_reason, a.on_hold_date, a.on_hold_by, a.is_referral_deal, a.opportunity_num, a.officename, a.cbre_rep_client, a.storage_comp_info, a.lead_broker, a.conversion_code, a.is_converted_deal, a.deal_live_flg, a.deal_live_date, a.orig_deal_num, a.entry_dt, a.business_unit_pc, a.project_id, a.activity_id, a.completed_date, a.deal_user_status, a.submitted_by, a.submitted_dttm, a.approval_status, a.approved_by, a.approvedttm, a.last_approved_by, a.last_approvedttm, a.pc_distrib_status, a.process_instance, a.post_status, a.in_process_flg, a.tot_budject, a.comm_agmnt_type, a.pct_amt_1, a.pct_amt_2, a.pct_amt_3, a.pct_amt_4, a.pct_amt_5, a.tot_cons, a.tot_comm, a.cancel_reason, a.created_by, a.created_dttm, a.last_update_by, a.last_update_dttm, a.syncid, a.syncdttm, a.project_num, a.cb_affiliate_refer, a.cb_affiliat_office, a.source_by, a.source_officename, a.descrlong, a.cb_rel_to_oth_deal, a.cb_related_deal_id
                           Sort Key: a.deal_id
                           ->  Foreign Scan on public.ps_cbta_deal_hdr a  (cost=10000.00..10000.00 rows=1000 width=1940)
                                 Output: a.business_unit, a.deal_id, a.lob, a.deal_type, a.lead_deptid, a.deal_status, a.office_deal, a.version_num, a.dont_send_vol_flg, a.is_confidential, a.currency_cd, a.associated_deal_id, a.is_dual_rep_deal, a.is_dispropor_deal, a.on_hold, a.on_hold_reason, a.on_hold_date, a.on_hold_by, a.is_referral_deal, a.opportunity_num, a.officename, a.cbre_rep_client, a.storage_comp_info, a.lead_broker, a.conversion_code, a.is_converted_deal, a.deal_live_flg, a.deal_live_date, a.orig_deal_num, a.entry_dt, a.business_unit_pc, a.project_id, a.activity_id, a.completed_date, a.deal_user_status, a.submitted_by, a.submitted_dttm, a.approval_status, a.approved_by, a.approvedttm, a.last_approved_by, a.last_approvedttm, a.pc_distrib_status, a.process_instance, a.post_status, a.in_process_flg, a.tot_budject, a.comm_agmnt_type, a.pct_amt_1, a.pct_amt_2, a.pct_amt_3, a.pct_amt_4, a.pct_amt_5, a.tot_cons, a.tot_comm, a.cancel_reason, a.created_by, a.created_dttm, a.last_update_by, a.last_update_dttm, a.syncid, a.syncdttm, a.project_num, a.cb_affiliate_refer, a.cb_affiliat_office, a.source_by, a.source_officename, a.descrlong, a.cb_rel_to_oth_deal, a.cb_related_deal_id
                                 Oracle query: SELECT /*8aa1fbc5578d3cffac307b9dae14bde0*/ "BUSINESS_UNIT", "DEAL_ID", "LOB", "DEAL_TYPE", "LEAD_DEPTID", "DEAL_STATUS", "OFFICE_DEAL", "VERSION_NUM", "DONT_SEND_VOL_FLG", "IS_CONFIDENTIAL", "CURRENCY_CD", "ASSOCIATED_DEAL_ID", "IS_DUAL_REP_DEAL", "IS_DISPROPOR_DEAL", "ON_HOLD", "ON_HOLD_REASON", "ON_HOLD_DATE", "ON_HOLD_BY", "IS_REFERRAL_DEAL", "OPPORTUNITY_NUM", "OFFICENAME", "CBRE_REP_CLIENT", "STORAGE_COMP_INFO", "LEAD_BROKER", "CONVERSION_CODE", "IS_CONVERTED_DEAL", "DEAL_LIVE_FLG", "DEAL_LIVE_DATE", "ORIG_DEAL_NUM", "ENTRY_DT", "BUSINESS_UNIT_PC", "PROJECT_ID", "ACTIVITY_ID", "COMPLETED_DATE", "DEAL_USER_STATUS", "SUBMITTED_BY", "SUBMITTED_DTTM", "APPROVAL_STATUS", "APPROVED_BY", "APPROVEDTTM", "LAST_APPROVED_BY", "LAST_APPROVEDTTM", "PC_DISTRIB_STATUS", "PROCESS_INSTANCE", "POST_STATUS", "IN_PROCESS_FLG", "TOT_BUDJECT", "COMM_AGMNT_TYPE", "PCT_AMT_1", "PCT_AMT_2", "PCT_AMT_3", "PCT_AMT_4", "PCT_AMT_5", "TOT_CONS", "TOT_COMM", "CANCEL_REASON", "CREATED_BY", "CREATED_DTTM", "LAST_UPDATE_BY", "LAST_UPDATE_DTTM", "SYNCID", "SYNCDTTM", "PROJECT_NUM", "CB_AFFILIATE_REFER", "CB_AFFILIAT_OFFICE", "SOURCE_BY", "SOURCE_OFFICENAME", "DESCRLONG", "CB_REL_TO_OTH_DEAL", "CB_RELATED_DEAL_ID" FROM "SYSADM"."PS_CBTA_DEAL_HDR"
                                 Oracle plan: SELECT STATEMENT
                                 Oracle plan:   TABLE ACCESS STORAGE FULL PS_CBTA_DEAL_HDR
                     ->  Materialize  (cost=11456.83..11461.83 rows=1000 width=3258)
                           Output: b.business_unit, b.deal_id, b.relationtype, b.relationship_id, b.active_flag, b.primary_flag, b.cust_id, b.address_seq_num, b.cust_source_id, b.refer_to_cust_id, b.bill_to_clnt, b.bus_use_id, b.naics_id, b.location_id, b.alt_cust_name, b.corporate_setid, b.corporate_cust_id, b.contact_id, b.cntct_seq_num, b.is_conf_cust, b.contact_name, b.contact_title, b.contact_phone, b.contact_email, b.purchaser_type, b.investor_type, b.investor_lndr_type, b.tenant_crdt_rating, b.property_id, b.mix_propid, b.space_type, b.ownership_type, b.property_status, b.propertyname, b.suite_num, b.parcel_size, b.parcel_size_uom, b.area_leased_sold, b.area_uom, b.managed_prop, b.portfolio_name, b.is_conf_prop, b.is_listed_by_cb, b.development_prop, b.tcc_di_prop, b.sale_lease_back, b.units_num, b.tenants_num, b.net_rentable_area, b.project_id, b.property_type, b.prop_sub_type, b.building_class, b.investment_prop, b.expiration_date, b.lease_type, b.lease_income_type, b.lease_exec_dt, b.est_occupancy_dt, b.sublease_flg, b.lease_from_dt, b.lease_to_dt, b.lease_concession, b.annual_rent, b.retl_tenant_typ_id, b.annual_rent_uom, b.est_close_dt, b.sch_gross_income, b.vaccancy_pct, b.property_expense, b.net_oprtng_income, b.cap_rate_yield, b.spendable_retn, b.occupancy_pct, b.exchange_flg, b.created_by, b.created_dttm, b.last_update_by, b.last_update_dttm, b.syncid, b.syncdttm, b.cb_floor_num, b.cb_prior_address1, b.cb_prior_address2, b.cb_prior_address3, b.cb_prior_address4, b.cb_prior_city, b.cb_prior_country, b.cb_prior_postal, b.cb_prior_state, b.cb_prior_county, b.cb_prior_rent_sft, b.cb_tnt_impr_amt, b.cb_tnt_pay_comm, b.cb_free_rent, b.cb_othr_concess, b.cb_no_seats
                           ->  Sort  (cost=11456.83..11459.33 rows=1000 width=3258)
                                 Output: b.business_unit, b.deal_id, b.relationtype, b.relationship_id, b.active_flag, b.primary_flag, b.cust_id, b.address_seq_num, b.cust_source_id, b.refer_to_cust_id, b.bill_to_clnt, b.bus_use_id, b.naics_id, b.location_id, b.alt_cust_name, b.corporate_setid, b.corporate_cust_id, b.contact_id, b.cntct_seq_num, b.is_conf_cust, b.contact_name, b.contact_title, b.contact_phone, b.contact_email, b.purchaser_type, b.investor_type, b.investor_lndr_type, b.tenant_crdt_rating, b.property_id, b.mix_propid, b.space_type, b.ownership_type, b.property_status, b.propertyname, b.suite_num, b.parcel_size, b.parcel_size_uom, b.area_leased_sold, b.area_uom, b.managed_prop, b.portfolio_name, b.is_conf_prop, b.is_listed_by_cb, b.development_prop, b.tcc_di_prop, b.sale_lease_back, b.units_num, b.tenants_num, b.net_rentable_area, b.project_id, b.property_type, b.prop_sub_type, b.building_class, b.investment_prop, b.expiration_date, b.lease_type, b.lease_income_type, b.lease_exec_dt, b.est_occupancy_dt, b.sublease_flg, b.lease_from_dt, b.lease_to_dt, b.lease_concession, b.annual_rent, b.retl_tenant_typ_id, b.annual_rent_uom, b.est_close_dt, b.sch_gross_income, b.vaccancy_pct, b.property_expense, b.net_oprtng_income, b.cap_rate_yield, b.spendable_retn, b.occupancy_pct, b.exchange_flg, b.created_by, b.created_dttm, b.last_update_by, b.last_update_dttm, b.syncid, b.syncdttm, b.cb_floor_num, b.cb_prior_address1, b.cb_prior_address2, b.cb_prior_address3, b.cb_prior_address4, b.cb_prior_city, b.cb_prior_country, b.cb_prior_postal, b.cb_prior_state, b.cb_prior_county, b.cb_prior_rent_sft, b.cb_tnt_impr_amt, b.cb_tnt_pay_comm, b.cb_free_rent, b.cb_othr_concess, b.cb_no_seats
                                 Sort Key: b.deal_id
                                 ->  Foreign Scan on public.ps_cbta_deal_rel b  (cost=10000.00..10000.00 rows=1000 width=3258)
                                       Output: b.business_unit, b.deal_id, b.relationtype, b.relationship_id, b.active_flag, b.primary_flag, b.cust_id, b.address_seq_num, b.cust_source_id, b.refer_to_cust_id, b.bill_to_clnt, b.bus_use_id, b.naics_id, b.location_id, b.alt_cust_name, b.corporate_setid, b.corporate_cust_id, b.contact_id, b.cntct_seq_num, b.is_conf_cust, b.contact_name, b.contact_title, b.contact_phone, b.contact_email, b.purchaser_type, b.investor_type, b.investor_lndr_type, b.tenant_crdt_rating, b.property_id, b.mix_propid, b.space_type, b.ownership_type, b.property_status, b.propertyname, b.suite_num, b.parcel_size, b.parcel_size_uom, b.area_leased_sold, b.area_uom, b.managed_prop, b.portfolio_name, b.is_conf_prop, b.is_listed_by_cb, b.development_prop, b.tcc_di_prop, b.sale_lease_back, b.units_num, b.tenants_num, b.net_rentable_area, b.project_id, b.property_type, b.prop_sub_type, b.building_class, b.investment_prop, b.expiration_date, b.lease_type, b.lease_income_type, b.lease_exec_dt, b.est_occupancy_dt, b.sublease_flg, b.lease_from_dt, b.lease_to_dt, b.lease_concession, b.annual_rent, b.retl_tenant_typ_id, b.annual_rent_uom, b.est_close_dt, b.sch_gross_income, b.vaccancy_pct, b.property_expense, b.net_oprtng_income, b.cap_rate_yield, b.spendable_retn, b.occupancy_pct, b.exchange_flg, b.created_by, b.created_dttm, b.last_update_by, b.last_update_dttm, b.syncid, b.syncdttm, b.cb_floor_num, b.cb_prior_address1, b.cb_prior_address2, b.cb_prior_address3, b.cb_prior_address4, b.cb_prior_city, b.cb_prior_country, b.cb_prior_postal, b.cb_prior_state, b.cb_prior_county, b.cb_prior_rent_sft, b.cb_tnt_impr_amt, b.cb_tnt_pay_comm, b.cb_free_rent, b.cb_othr_concess, b.cb_no_seats
                                       Oracle query: SELECT /*31da900c477947b0dd9673b81ee161e0*/ "BUSINESS_UNIT", "DEAL_ID", "RELATIONTYPE", "RELATIONSHIP_ID", "ACTIVE_FLAG", "PRIMARY_FLAG", "CUST_ID", "ADDRESS_SEQ_NUM", "CUST_SOURCE_ID", "REFER_TO_CUST_ID", "BILL_TO_CLNT", "BUS_USE_ID", "NAICS_ID", "LOCATION_ID", "ALT_CUST_NAME", "CORPORATE_SETID", "CORPORATE_CUST_ID", "CONTACT_ID", "CNTCT_SEQ_NUM", "IS_CONF_CUST", "CONTACT_NAME", "CONTACT_TITLE", "CONTACT_PHONE", "CONTACT_EMAIL", "PURCHASER_TYPE", "INVESTOR_TYPE", "INVESTOR_LNDR_TYPE", "TENANT_CRDT_RATING", "PROPERTY_ID", "MIX_PROPID", "SPACE_TYPE", "OWNERSHIP_TYPE", "PROPERTY_STATUS", "PROPERTYNAME", "SUITE_NUM", "PARCEL_SIZE", "PARCEL_SIZE_UOM", "AREA_LEASED_SOLD", "AREA_UOM", "MANAGED_PROP", "PORTFOLIO_NAME", "IS_CONF_PROP", "IS_LISTED_BY_CB", "DEVELOPMENT_PROP", "TCC_DI_PROP", "SALE_LEASE_BACK", "UNITS_NUM", "TENANTS_NUM", "NET_RENTABLE_AREA", "PROJECT_ID", "PROPERTY_TYPE", "PROP_SUB_TYPE", "BUILDING_CLASS", "INVESTMENT_PROP", "EXPIRATION_DATE", "LEASE_TYPE", "LEASE_INCOME_TYPE", "LEASE_EXEC_DT", "EST_OCCUPANCY_DT", "SUBLEASE_FLG", "LEASE_FROM_DT", "LEASE_TO_DT", "LEASE_CONCESSION", "ANNUAL_RENT", "RETL_TENANT_TYP_ID", "ANNUAL_RENT_UOM", "EST_CLOSE_DT", "SCH_GROSS_INCOME", "VACCANCY_PCT", "PROPERTY_EXPENSE", "NET_OPRTNG_INCOME", "CAP_RATE_YIELD", "SPENDABLE_RETN", "OCCUPANCY_PCT", "EXCHANGE_FLG", "CREATED_BY", "CREATED_DTTM", "LAST_UPDATE_BY", "LAST_UPDATE_DTTM", "SYNCID", "SYNCDTTM", "CB_FLOOR_NUM", "CB_PRIOR_ADDRESS1", "CB_PRIOR_ADDRESS2", "CB_PRIOR_ADDRESS3", "CB_PRIOR_ADDRESS4", "CB_PRIOR_CITY", "CB_PRIOR_COUNTRY", "CB_PRIOR_POSTAL", "CB_PRIOR_STATE", "CB_PRIOR_COUNTY", "CB_PRIOR_RENT_SFT", "CB_TNT_IMPR_AMT", "CB_TNT_PAY_COMM", "CB_FREE_RENT", "CB_OTHR_CONCESS", "CB_NO_SEATS" FROM "SYSADM"."PS_CBTA_DEAL_REL" WHERE ("RELATIONTYPE" = 'LEAS')
                                       Oracle plan: SELECT STATEMENT
                                       Oracle plan:   TABLE ACCESS STORAGE FULL PS_CBTA_DEAL_REL (condition "RELATIONTYPE"='LEAS') (filter "RELATIONTYPE"='LEAS')
               ->  Materialize  (cost=11456.83..11461.83 rows=1000 width=3258)
                     Output: c.business_unit, c.deal_id, c.relationtype, c.relationship_id, c.active_flag, c.primary_flag, c.cust_id, c.address_seq_num, c.cust_source_id, c.refer_to_cust_id, c.bill_to_clnt, c.bus_use_id, c.naics_id, c.location_id, c.alt_cust_name, c.corporate_setid, c.corporate_cust_id, c.contact_id, c.cntct_seq_num, c.is_conf_cust, c.contact_name, c.contact_title, c.contact_phone, c.contact_email, c.purchaser_type, c.investor_type, c.investor_lndr_type, c.tenant_crdt_rating, c.property_id, c.mix_propid, c.space_type, c.ownership_type, c.property_status, c.propertyname, c.suite_num, c.parcel_size, c.parcel_size_uom, c.area_leased_sold, c.area_uom, c.managed_prop, c.portfolio_name, c.is_conf_prop, c.is_listed_by_cb, c.development_prop, c.tcc_di_prop, c.sale_lease_back, c.units_num, c.tenants_num, c.net_rentable_area, c.project_id, c.property_type, c.prop_sub_type, c.building_class, c.investment_prop, c.expiration_date, c.lease_type, c.lease_income_type, c.lease_exec_dt, c.est_occupancy_dt, c.sublease_flg, c.lease_from_dt, c.lease_to_dt, c.lease_concession, c.annual_rent, c.retl_tenant_typ_id, c.annual_rent_uom, c.est_close_dt, c.sch_gross_income, c.vaccancy_pct, c.property_expense, c.net_oprtng_income, c.cap_rate_yield, c.spendable_retn, c.occupancy_pct, c.exchange_flg, c.created_by, c.created_dttm, c.last_update_by, c.last_update_dttm, c.syncid, c.syncdttm, c.cb_floor_num, c.cb_prior_address1, c.cb_prior_address2, c.cb_prior_address3, c.cb_prior_address4, c.cb_prior_city, c.cb_prior_country, c.cb_prior_postal, c.cb_prior_state, c.cb_prior_county, c.cb_prior_rent_sft, c.cb_tnt_impr_amt, c.cb_tnt_pay_comm, c.cb_free_rent, c.cb_othr_concess, c.cb_no_seats
                     ->  Sort  (cost=11456.83..11459.33 rows=1000 width=3258)
                           Output: c.business_unit, c.deal_id, c.relationtype, c.relationship_id, c.active_flag, c.primary_flag, c.cust_id, c.address_seq_num, c.cust_source_id, c.refer_to_cust_id, c.bill_to_clnt, c.bus_use_id, c.naics_id, c.location_id, c.alt_cust_name, c.corporate_setid, c.corporate_cust_id, c.contact_id, c.cntct_seq_num, c.is_conf_cust, c.contact_name, c.contact_title, c.contact_phone, c.contact_email, c.purchaser_type, c.investor_type, c.investor_lndr_type, c.tenant_crdt_rating, c.property_id, c.mix_propid, c.space_type, c.ownership_type, c.property_status, c.propertyname, c.suite_num, c.parcel_size, c.parcel_size_uom, c.area_leased_sold, c.area_uom, c.managed_prop, c.portfolio_name, c.is_conf_prop, c.is_listed_by_cb, c.development_prop, c.tcc_di_prop, c.sale_lease_back, c.units_num, c.tenants_num, c.net_rentable_area, c.project_id, c.property_type, c.prop_sub_type, c.building_class, c.investment_prop, c.expiration_date, c.lease_type, c.lease_income_type, c.lease_exec_dt, c.est_occupancy_dt, c.sublease_flg, c.lease_from_dt, c.lease_to_dt, c.lease_concession, c.annual_rent, c.retl_tenant_typ_id, c.annual_rent_uom, c.est_close_dt, c.sch_gross_income, c.vaccancy_pct, c.property_expense, c.net_oprtng_income, c.cap_rate_yield, c.spendable_retn, c.occupancy_pct, c.exchange_flg, c.created_by, c.created_dttm, c.last_update_by, c.last_update_dttm, c.syncid, c.syncdttm, c.cb_floor_num, c.cb_prior_address1, c.cb_prior_address2, c.cb_prior_address3, c.cb_prior_address4, c.cb_prior_city, c.cb_prior_country, c.cb_prior_postal, c.cb_prior_state, c.cb_prior_county, c.cb_prior_rent_sft, c.cb_tnt_impr_amt, c.cb_tnt_pay_comm, c.cb_free_rent, c.cb_othr_concess, c.cb_no_seats
                           Sort Key: c.deal_id
                           ->  Foreign Scan on public.ps_cbta_deal_rel c  (cost=10000.00..10000.00 rows=1000 width=3258)
                                 Output: c.business_unit, c.deal_id, c.relationtype, c.relationship_id, c.active_flag, c.primary_flag, c.cust_id, c.address_seq_num, c.cust_source_id, c.refer_to_cust_id, c.bill_to_clnt, c.bus_use_id, c.naics_id, c.location_id, c.alt_cust_name, c.corporate_setid, c.corporate_cust_id, c.contact_id, c.cntct_seq_num, c.is_conf_cust, c.contact_name, c.contact_title, c.contact_phone, c.contact_email, c.purchaser_type, c.investor_type, c.investor_lndr_type, c.tenant_crdt_rating, c.property_id, c.mix_propid, c.space_type, c.ownership_type, c.property_status, c.propertyname, c.suite_num, c.parcel_size, c.parcel_size_uom, c.area_leased_sold, c.area_uom, c.managed_prop, c.portfolio_name, c.is_conf_prop, c.is_listed_by_cb, c.development_prop, c.tcc_di_prop, c.sale_lease_back, c.units_num, c.tenants_num, c.net_rentable_area, c.project_id, c.property_type, c.prop_sub_type, c.building_class, c.investment_prop, c.expiration_date, c.lease_type, c.lease_income_type, c.lease_exec_dt, c.est_occupancy_dt, c.sublease_flg, c.lease_from_dt, c.lease_to_dt, c.lease_concession, c.annual_rent, c.retl_tenant_typ_id, c.annual_rent_uom, c.est_close_dt, c.sch_gross_income, c.vaccancy_pct, c.property_expense, c.net_oprtng_income, c.cap_rate_yield, c.spendable_retn, c.occupancy_pct, c.exchange_flg, c.created_by, c.created_dttm, c.last_update_by, c.last_update_dttm, c.syncid, c.syncdttm, c.cb_floor_num, c.cb_prior_address1, c.cb_prior_address2, c.cb_prior_address3, c.cb_prior_address4, c.cb_prior_city, c.cb_prior_country, c.cb_prior_postal, c.cb_prior_state, c.cb_prior_county, c.cb_prior_rent_sft, c.cb_tnt_impr_amt, c.cb_tnt_pay_comm, c.cb_free_rent, c.cb_othr_concess, c.cb_no_seats
                                 Oracle query: SELECT /*e6c25db8d14c9119bdc4e665700e423c*/ "BUSINESS_UNIT", "DEAL_ID", "RELATIONTYPE", "RELATIONSHIP_ID", "ACTIVE_FLAG", "PRIMARY_FLAG", "CUST_ID", "ADDRESS_SEQ_NUM", "CUST_SOURCE_ID", "REFER_TO_CUST_ID", "BILL_TO_CLNT", "BUS_USE_ID", "NAICS_ID", "LOCATION_ID", "ALT_CUST_NAME", "CORPORATE_SETID", "CORPORATE_CUST_ID", "CONTACT_ID", "CNTCT_SEQ_NUM", "IS_CONF_CUST", "CONTACT_NAME", "CONTACT_TITLE", "CONTACT_PHONE", "CONTACT_EMAIL", "PURCHASER_TYPE", "INVESTOR_TYPE", "INVESTOR_LNDR_TYPE", "TENANT_CRDT_RATING", "PROPERTY_ID", "MIX_PROPID", "SPACE_TYPE", "OWNERSHIP_TYPE", "PROPERTY_STATUS", "PROPERTYNAME", "SUITE_NUM", "PARCEL_SIZE", "PARCEL_SIZE_UOM", "AREA_LEASED_SOLD", "AREA_UOM", "MANAGED_PROP", "PORTFOLIO_NAME", "IS_CONF_PROP", "IS_LISTED_BY_CB", "DEVELOPMENT_PROP", "TCC_DI_PROP", "SALE_LEASE_BACK", "UNITS_NUM", "TENANTS_NUM", "NET_RENTABLE_AREA", "PROJECT_ID", "PROPERTY_TYPE", "PROP_SUB_TYPE", "BUILDING_CLASS", "INVESTMENT_PROP", "EXPIRATION_DATE", "LEASE_TYPE", "LEASE_INCOME_TYPE", "LEASE_EXEC_DT", "EST_OCCUPANCY_DT", "SUBLEASE_FLG", "LEASE_FROM_DT", "LEASE_TO_DT", "LEASE_CONCESSION", "ANNUAL_RENT", "RETL_TENANT_TYP_ID", "ANNUAL_RENT_UOM", "EST_CLOSE_DT", "SCH_GROSS_INCOME", "VACCANCY_PCT", "PROPERTY_EXPENSE", "NET_OPRTNG_INCOME", "CAP_RATE_YIELD", "SPENDABLE_RETN", "OCCUPANCY_PCT", "EXCHANGE_FLG", "CREATED_BY", "CREATED_DTTM", "LAST_UPDATE_BY", "LAST_UPDATE_DTTM", "SYNCID", "SYNCDTTM", "CB_FLOOR_NUM", "CB_PRIOR_ADDRESS1", "CB_PRIOR_ADDRESS2", "CB_PRIOR_ADDRESS3", "CB_PRIOR_ADDRESS4", "CB_PRIOR_CITY", "CB_PRIOR_COUNTRY", "CB_PRIOR_POSTAL", "CB_PRIOR_STATE", "CB_PRIOR_COUNTY", "CB_PRIOR_RENT_SFT", "CB_TNT_IMPR_AMT", "CB_TNT_PAY_COMM", "CB_FREE_RENT", "CB_OTHR_CONCESS", "CB_NO_SEATS" FROM "SYSADM"."PS_CBTA_DEAL_REL" WHERE ("RELATIONTYPE" = 'PROP')
                                 Oracle plan: SELECT STATEMENT
                                 Oracle plan:   TABLE ACCESS STORAGE FULL PS_CBTA_DEAL_REL (condition "RELATIONTYPE"='PROP') (filter "RELATIONTYPE"='PROP')
(47 rows)

from oracle_fdw.

laurenz avatar laurenz commented on August 14, 2024

I created simple tables main_table and join_table and ran the query from your initial example, which worked fine, so I cannot reproduce the problem yet.

The ideal thing would be a self-contained test case (Oracle and PostgreSQL table definitions, data and a query) that causes the hang. I understand that that might be difficult.

I can think of three simpler things that might help me understand what is going on:

  • Set client_min_messages to debug2 and post the debug messages that you get when running the query.
  • When the query hangs, try to find out if it is truly hanging or working in an endless loop. I don't know your operating system, but on Linux you could use strace -p <pid> to attach to the database backend process and see if it does anything or not (detach with Ctrl+C).
  • Try to get a stack trace from the database backend process (see the Wiki article). For the stack trace to be useful, you should have debugging symbols for PostgreSQL and oracle_fdw installed.

from oracle_fdw.

laurenz avatar laurenz commented on August 14, 2024

Any news on the problem?

from oracle_fdw.

ckinsey avatar ckinsey commented on August 14, 2024

TL;DR: The oracle_fdw is not freezing, the query just takes quite a bit longer than expected to execute. Feel free to close this issue if the behavior I'm seeing is not unordinary.

After more testing it turned out that the query did eventually respond--it was not hung in a loop. We also discovered the response time is quite a bit faster when filtering the query via a WHERE clause as opposed to a LIMIT instruction.

Again the query is considerably faster in Oracle vs oracle_fdw (~5-7 seconds vs ~5-7 minutes). My hunch is that there is processing overhead in converting the Oracle datatypes to Postgres datatypes. This makes sense to me as we're looking at a very wide SELECT here where hundreds of columns by thousands of rows are converted. That's complete speculation by observation on my part as I'm really not familiar enough with the low level mechanics of these databases to be of much use digging further.

Our particular implementation is not impeded by the query taking that long due to its asynchronous nature, even though we don't fully understand where the latency is coming from.

from oracle_fdw.

laurenz avatar laurenz commented on August 14, 2024

Thanks for the feedback!

If you use PostgreSQL's EXPLAIN (ANALYZE) you can see where the time goes and compare that with the execution plan of the query in Oracle.
Since oracle_fdw cannot push down joins to the Oracle side (yet), all data required for the joins will be fetched to the PostgreSQL server and processed there. That is usually much less efficient than performing the joins in Oracle and fetching only the result.

The only remedy I can think of is to use a view in Oracle that performs the required join and access that view from PostgreSQL.

from oracle_fdw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.