sql - Oracle Deduping taking too long -


so have perfect dupes in table i've pulled down production last week (at end of day) i'm pretty sure didn't tick truncate first box in toad , have got nice bunch of dupes in table. i'm running following query:

delete mmi_owner.imart_tti_ret_my_customers a1 exists (select 'x' mmi_owner.imart_tti_ret_my_customers a2               a1.rowid <> a2.rowid               ,   ((a1.measure_id = a2.measure_id) or ((a1.measure_id null) , (a2.measure_id null)))               ,   ((a1.measure_name = a2.measure_name) or ((a1.measure_name null) , (a2.measure_name null)))               ,   ((a1.measure_description = a2.measure_description) or ((a1.measure_description null) , (a2.measure_description null)))               ,   ((a1.measure_format = a2.measure_format) or ((a1.measure_format null) , (a2.measure_format null)))               ,   ((a1.entity_id = a2.entity_id) or ((a1.entity_id null) , (a2.entity_id null)))               ,   ((a1.entity_description = a2.entity_description) or ((a1.entity_description null) , (a2.entity_description null)))               ,   ((a1.parent_entity_id = a2.parent_entity_id) or ((a1.parent_entity_id null) , (a2.parent_entity_id null)))               ,   ((a1.has_children = a2.has_children) or ((a1.has_children null) , (a2.has_children null)))               ,   ((a1.has_hierarchy = a2.has_hierarchy) or ((a1.has_hierarchy null) , (a2.has_hierarchy null)))               ,   ((a1.has_people = a2.has_people) or ((a1.has_people null) , (a2.has_people null)))               ,   ((a1.is_branch = a2.is_branch) or ((a1.is_branch null) , (a2.is_branch null)))               ,   ((a1.partition_key = a2.partition_key) or ((a1.partition_key null) , (a2.partition_key null)))               ,   ((a1.sort_order = a2.sort_order) or ((a1.sort_order null) , (a2.sort_order null)))               ,   ((a1.week_minus_1 = a2.week_minus_1) or ((a1.week_minus_1 null) , (a2.week_minus_1 null)))               ,   ((a1.week_minus_1_format = a2.week_minus_1_format) or ((a1.week_minus_1_format null) , (a2.week_minus_1_format null)))               ,   ((a1.week_minus_1_perf = a2.week_minus_1_perf) or ((a1.week_minus_1_perf null) , (a2.week_minus_1_perf null)))               ,   ((a1.week_minus_1_perf_rag = a2.week_minus_1_perf_rag) or ((a1.week_minus_1_perf_rag null) , (a2.week_minus_1_perf_rag null)))               ,   ((a1.week1 = a2.week1) or ((a1.week1 null) , (a2.week1 null)))               ,   ((a1.week1_format = a2.week1_format) or ((a1.week1_format null) , (a2.week1_format null)))               ,   ((a1.week1_perf = a2.week1_perf) or ((a1.week1_perf null) , (a2.week1_perf null)))               ,   ((a1.week1_perf_rag = a2.week1_perf_rag) or ((a1.week1_perf_rag null) , (a2.week1_perf_rag null)))               ,   ((a1.week2 = a2.week2) or ((a1.week2 null) , (a2.week2 null)))               ,   ((a1.week2_format = a2.week2_format) or ((a1.week2_format null) , (a2.week2_format null)))               ,   ((a1.week2_perf = a2.week2_perf) or ((a1.week2_perf null) , (a2.week2_perf null)))               ,   ((a1.week2_perf_rag = a2.week2_perf_rag) or ((a1.week2_perf_rag null) , (a2.week2_perf_rag null)))               ,   ((a1.week3 = a2.week3) or ((a1.week3 null) , (a2.week3 null)))               ,   ((a1.week3_format = a2.week3_format) or ((a1.week3_format null) , (a2.week3_format null)))               ,   ((a1.week3_perf = a2.week3_perf) or ((a1.week3_perf null) , (a2.week3_perf null)))               ,   ((a1.week3_perf_rag = a2.week3_perf_rag) or ((a1.week3_perf_rag null) , (a2.week3_perf_rag null)))               ,   ((a1.week4 = a2.week4) or ((a1.week4 null) , (a2.week4 null)))               ,   ((a1.week4_format = a2.week4_format) or ((a1.week4_format null) , (a2.week4_format null)))               ,   ((a1.week4_perf = a2.week4_perf) or ((a1.week4_perf null) , (a2.week4_perf null)))               ,   ((a1.week4_perf_rag = a2.week4_perf_rag) or ((a1.week4_perf_rag null) , (a2.week4_perf_rag null)))               ,   ((a1.week5 = a2.week5) or ((a1.week5 null) , (a2.week5 null)))               ,   ((a1.week5_format = a2.week5_format) or ((a1.week5_format null) , (a2.week5_format null)))               ,   ((a1.week5_perf = a2.week5_perf) or ((a1.week5_perf null) , (a2.week5_perf null)))               ,   ((a1.week5_perf_rag = a2.week5_perf_rag) or ((a1.week5_perf_rag null) , (a2.week5_perf_rag null)))               ,   ((a1.fivewkavg = a2.fivewkavg) or ((a1.fivewkavg null) , (a2.fivewkavg null)))               ,   ((a1.fivewkavg_format = a2.fivewkavg_format) or ((a1.fivewkavg_format null) , (a2.fivewkavg_format null)))               ,   ((a1.fivewkavg_perf = a2.fivewkavg_perf) or ((a1.fivewkavg_perf null) , (a2.fivewkavg_perf null)))               ,   ((a1.fivewkavg_perf_rag = a2.fivewkavg_perf_rag) or ((a1.fivewkavg_perf_rag null) , (a2.fivewkavg_perf_rag null)))               ,   ((a1.prev_fivewkavg = a2.prev_fivewkavg) or ((a1.prev_fivewkavg null) , (a2.prev_fivewkavg null)))               ,   ((a1.prev_fivewkavg_format = a2.prev_fivewkavg_format) or ((a1.prev_fivewkavg_format null) , (a2.prev_fivewkavg_format null)))               ,   ((a1.prev_fivewkavg_perf = a2.prev_fivewkavg_perf) or ((a1.prev_fivewkavg_perf null) , (a2.prev_fivewkavg_perf null)))               ,   ((a1.prev_fivewkavg_perf_rag = a2.prev_fivewkavg_perf_rag) or ((a1.prev_fivewkavg_perf_rag null) , (a2.prev_fivewkavg_perf_rag null)))               ,   ((a1.fivewkavg_change = a2.fivewkavg_change) or ((a1.fivewkavg_change null) , (a2.fivewkavg_change null)))               ,   ((a1.fivewkavg_change_format = a2.fivewkavg_change_format) or ((a1.fivewkavg_change_format null) , (a2.fivewkavg_change_format null)))               ,   ((a1.fivewkavg_change_perf = a2.fivewkavg_change_perf) or ((a1.fivewkavg_change_perf null) , (a2.fivewkavg_change_perf null)))               ,   ((a1.fivewkavg_change_perf_rag = a2.fivewkavg_change_perf_rag) or ((a1.fivewkavg_change_perf_rag null) , (a2.fivewkavg_change_perf_rag null)))               ,   ((a1.month1 = a2.month1) or ((a1.month1 null) , (a2.month1 null)))               ,   ((a1.month1_format = a2.month1_format) or ((a1.month1_format null) , (a2.month1_format null)))               ,   ((a1.month1_perf = a2.month1_perf) or ((a1.month1_perf null) , (a2.month1_perf null)))               ,   ((a1.month1_perf_rag = a2.month1_perf_rag) or ((a1.month1_perf_rag null) , (a2.month1_perf_rag null)))               ,   ((a1.month2 = a2.month2) or ((a1.month2 null) , (a2.month2 null)))               ,   ((a1.month2_format = a2.month2_format) or ((a1.month2_format null) , (a2.month2_format null)))               ,   ((a1.month2_perf = a2.month2_perf) or ((a1.month2_perf null) , (a2.month2_perf null)))               ,   ((a1.month2_perf_rag = a2.month2_perf_rag) or ((a1.month2_perf_rag null) , (a2.month2_perf_rag null)))               ,   ((a1.month3 = a2.month3) or ((a1.month3 null) , (a2.month3 null)))               ,   ((a1.month3_format = a2.month3_format) or ((a1.month3_format null) , (a2.month3_format null)))               ,   ((a1.month3_perf = a2.month3_perf) or ((a1.month3_perf null) , (a2.month3_perf null)))               ,   ((a1.month3_perf_rag = a2.month3_perf_rag) or ((a1.month3_perf_rag null) , (a2.month3_perf_rag null)))               ,   ((a1.month4 = a2.month4) or ((a1.month4 null) , (a2.month4 null)))               ,   ((a1.month4_format = a2.month4_format) or ((a1.month4_format null) , (a2.month4_format null)))               ,   ((a1.month4_perf = a2.month4_perf) or ((a1.month4_perf null) , (a2.month4_perf null)))               ,   ((a1.month4_perf_rag = a2.month4_perf_rag) or ((a1.month4_perf_rag null) , (a2.month4_perf_rag null)))               ,   ((a1.month5 = a2.month5) or ((a1.month5 null) , (a2.month5 null)))               ,   ((a1.month5_format = a2.month5_format) or ((a1.month5_format null) , (a2.month5_format null)))               ,   ((a1.month5_perf = a2.month5_perf) or ((a1.month5_perf null) , (a2.month5_perf null)))               ,   ((a1.month5_perf_rag = a2.month5_perf_rag) or ((a1.month5_perf_rag null) , (a2.month5_perf_rag null)))               ,   ((a1.month6 = a2.month6) or ((a1.month6 null) , (a2.month6 null)))               ,   ((a1.month6_format = a2.month6_format) or ((a1.month6_format null) , (a2.month6_format null)))               ,   ((a1.month6_perf = a2.month6_perf) or ((a1.month6_perf null) , (a2.month6_perf null)))               ,   ((a1.month6_perf_rag = a2.month6_perf_rag) or ((a1.month6_perf_rag null) , (a2.month6_perf_rag null)))               ,   ((a1.qtd = a2.qtd) or ((a1.qtd null) , (a2.qtd null)))               ,   ((a1.qtd_format = a2.qtd_format) or ((a1.qtd_format null) , (a2.qtd_format null)))               ,   ((a1.qtd_perf = a2.qtd_perf) or ((a1.qtd_perf null) , (a2.qtd_perf null)))               ,   ((a1.qtd_perf_rag = a2.qtd_perf_rag) or ((a1.qtd_perf_rag null) , (a2.qtd_perf_rag null)))               ,   ((a1.htd = a2.htd) or ((a1.htd null) , (a2.htd null)))               ,   ((a1.htd_format = a2.htd_format) or ((a1.htd_format null) , (a2.htd_format null)))               ,   ((a1.htd_perf = a2.htd_perf) or ((a1.htd_perf null) , (a2.htd_perf null)))               ,   ((a1.htd_perf_rag = a2.htd_perf_rag) or ((a1.htd_perf_rag null) , (a2.htd_perf_rag null)))               ,   ((a1.ytd = a2.ytd) or ((a1.ytd null) , (a2.ytd null)))               ,   ((a1.ytd_format = a2.ytd_format) or ((a1.ytd_format null) , (a2.ytd_format null)))               ,   ((a1.ytd_perf = a2.ytd_perf) or ((a1.ytd_perf null) , (a2.ytd_perf null)))               ,   ((a1.ytd_perf_rag = a2.ytd_perf_rag) or ((a1.ytd_perf_rag null) , (a2.ytd_perf_rag null)))               ,   ((a1.parent_measure_id = a2.parent_measure_id) or ((a1.parent_measure_id null) , (a2.parent_measure_id null)))               ,   ((a1.measure_type = a2.measure_type) or ((a1.measure_type null) , (a2.measure_type null)))               ,   ((a1.measure_group = a2.measure_group) or ((a1.measure_group null) , (a2.measure_group null)))               ,   ((a1.parent_measure_description = a2.parent_measure_description) or ((a1.parent_measure_description null) , (a2.parent_measure_description null)))               ,   ((a1.lv2_fivewkavg = a2.lv2_fivewkavg) or ((a1.lv2_fivewkavg null) , (a2.lv2_fivewkavg null)))               ,   ((a1.lv2_fivewkavg_format = a2.lv2_fivewkavg_format) or ((a1.lv2_fivewkavg_format null) , (a2.lv2_fivewkavg_format null)))               ,   ((a1.lv2_fivewkavg_perf = a2.lv2_fivewkavg_perf) or ((a1.lv2_fivewkavg_perf null) , (a2.lv2_fivewkavg_perf null)))               ,   ((a1.lv2_fivewkavg_perf_rag = a2.lv2_fivewkavg_perf_rag) or ((a1.lv2_fivewkavg_perf_rag null) , (a2.lv2_fivewkavg_perf_rag null)))               ,   ((a1.lv3_fivewkavg = a2.lv3_fivewkavg) or ((a1.lv3_fivewkavg null) , (a2.lv3_fivewkavg null)))               ,   ((a1.lv3_fivewkavg_format = a2.lv3_fivewkavg_format) or ((a1.lv3_fivewkavg_format null) , (a2.lv3_fivewkavg_format null)))               ,   ((a1.lv3_fivewkavg_perf = a2.lv3_fivewkavg_perf) or ((a1.lv3_fivewkavg_perf null) , (a2.lv3_fivewkavg_perf null)))               ,   ((a1.lv3_fivewkavg_perf_rag = a2.lv3_fivewkavg_perf_rag) or ((a1.lv3_fivewkavg_perf_rag null) , (a2.lv3_fivewkavg_perf_rag null)))               ,   ((a1.lv4_fivewkavg = a2.lv4_fivewkavg) or ((a1.lv4_fivewkavg null) , (a2.lv4_fivewkavg null)))               ,   ((a1.lv4_fivewkavg_format = a2.lv4_fivewkavg_format) or ((a1.lv4_fivewkavg_format null) , (a2.lv4_fivewkavg_format null)))               ,   ((a1.lv4_fivewkavg_perf = a2.lv4_fivewkavg_perf) or ((a1.lv4_fivewkavg_perf null) , (a2.lv4_fivewkavg_perf null)))               ,   ((a1.lv4_fivewkavg_perf_rag = a2.lv4_fivewkavg_perf_rag) or ((a1.lv4_fivewkavg_perf_rag null) , (a2.lv4_fivewkavg_perf_rag null)))               ,   ((a1.lv5_fivewkavg = a2.lv5_fivewkavg) or ((a1.lv5_fivewkavg null) , (a2.lv5_fivewkavg null)))               ,   ((a1.lv5_fivewkavg_format = a2.lv5_fivewkavg_format) or ((a1.lv5_fivewkavg_format null) , (a2.lv5_fivewkavg_format null)))               ,   ((a1.lv5_fivewkavg_perf = a2.lv5_fivewkavg_perf) or ((a1.lv5_fivewkavg_perf null) , (a2.lv5_fivewkavg_perf null)))               ,   ((a1.lv5_fivewkavg_perf_rag = a2.lv5_fivewkavg_perf_rag) or ((a1.lv5_fivewkavg_perf_rag null) , (a2.lv5_fivewkavg_perf_rag null)))               ,   ((a1.lv6_fivewkavg = a2.lv6_fivewkavg) or ((a1.lv6_fivewkavg null) , (a2.lv6_fivewkavg null)))               ,   ((a1.lv6_fivewkavg_format = a2.lv6_fivewkavg_format) or ((a1.lv6_fivewkavg_format null) , (a2.lv6_fivewkavg_format null)))               ,   ((a1.lv6_fivewkavg_perf = a2.lv6_fivewkavg_perf) or ((a1.lv6_fivewkavg_perf null) , (a2.lv6_fivewkavg_perf null)))               ,   ((a1.lv6_fivewkavg_perf_rag = a2.lv6_fivewkavg_perf_rag) or ((a1.lv6_fivewkavg_perf_rag null) , (a2.lv6_fivewkavg_perf_rag null)))               ,   ((a1.lv2_qtd = a2.lv2_qtd) or ((a1.lv2_qtd null) , (a2.lv2_qtd null)))               ,   ((a1.lv2_qtd_format = a2.lv2_qtd_format) or ((a1.lv2_qtd_format null) , (a2.lv2_qtd_format null)))               ,   ((a1.lv2_qtd_perf = a2.lv2_qtd_perf) or ((a1.lv2_qtd_perf null) , (a2.lv2_qtd_perf null)))               ,   ((a1.lv2_qtd_perf_rag = a2.lv2_qtd_perf_rag) or ((a1.lv2_qtd_perf_rag null) , (a2.lv2_qtd_perf_rag null)))               ,   ((a1.lv3_qtd = a2.lv3_qtd) or ((a1.lv3_qtd null) , (a2.lv3_qtd null)))               ,   ((a1.lv3_qtd_format = a2.lv3_qtd_format) or ((a1.lv3_qtd_format null) , (a2.lv3_qtd_format null)))               ,   ((a1.lv3_qtd_perf = a2.lv3_qtd_perf) or ((a1.lv3_qtd_perf null) , (a2.lv3_qtd_perf null)))               ,   ((a1.lv3_qtd_perf_rag = a2.lv3_qtd_perf_rag) or ((a1.lv3_qtd_perf_rag null) , (a2.lv3_qtd_perf_rag null)))               ,   ((a1.lv4_qtd = a2.lv4_qtd) or ((a1.lv4_qtd null) , (a2.lv4_qtd null)))               ,   ((a1.lv4_qtd_format = a2.lv4_qtd_format) or ((a1.lv4_qtd_format null) , (a2.lv4_qtd_format null)))               ,   ((a1.lv4_qtd_perf = a2.lv4_qtd_perf) or ((a1.lv4_qtd_perf null) , (a2.lv4_qtd_perf null)))               ,   ((a1.lv4_qtd_perf_rag = a2.lv4_qtd_perf_rag) or ((a1.lv4_qtd_perf_rag null) , (a2.lv4_qtd_perf_rag null)))               ,   ((a1.lv5_qtd = a2.lv5_qtd) or ((a1.lv5_qtd null) , (a2.lv5_qtd null)))               ,   ((a1.lv5_qtd_format = a2.lv5_qtd_format) or ((a1.lv5_qtd_format null) , (a2.lv5_qtd_format null)))               ,   ((a1.lv5_qtd_perf = a2.lv5_qtd_perf) or ((a1.lv5_qtd_perf null) , (a2.lv5_qtd_perf null)))               ,   ((a1.lv5_qtd_perf_rag = a2.lv5_qtd_perf_rag) or ((a1.lv5_qtd_perf_rag null) , (a2.lv5_qtd_perf_rag null)))               ,   ((a1.lv6_qtd = a2.lv6_qtd) or ((a1.lv6_qtd null) , (a2.lv6_qtd null)))               ,   ((a1.lv6_qtd_format = a2.lv6_qtd_format) or ((a1.lv6_qtd_format null) , (a2.lv6_qtd_format null)))               ,   ((a1.lv6_qtd_perf = a2.lv6_qtd_perf) or ((a1.lv6_qtd_perf null) , (a2.lv6_qtd_perf null)))               ,   ((a1.lv6_qtd_perf_rag = a2.lv6_qtd_perf_rag) or ((a1.lv6_qtd_perf_rag null) , (a2.lv6_qtd_perf_rag null)))               ,   ((a1.lv2_htd = a2.lv2_htd) or ((a1.lv2_htd null) , (a2.lv2_htd null)))               ,   ((a1.lv2_htd_format = a2.lv2_htd_format) or ((a1.lv2_htd_format null) , (a2.lv2_htd_format null)))               ,   ((a1.lv2_htd_perf = a2.lv2_htd_perf) or ((a1.lv2_htd_perf null) , (a2.lv2_htd_perf null)))               ,   ((a1.lv2_htd_perf_rag = a2.lv2_htd_perf_rag) or ((a1.lv2_htd_perf_rag null) , (a2.lv2_htd_perf_rag null)))               ,   ((a1.lv3_htd = a2.lv3_htd) or ((a1.lv3_htd null) , (a2.lv3_htd null)))               ,   ((a1.lv3_htd_format = a2.lv3_htd_format) or ((a1.lv3_htd_format null) , (a2.lv3_htd_format null)))               ,   ((a1.lv3_htd_perf = a2.lv3_htd_perf) or ((a1.lv3_htd_perf null) , (a2.lv3_htd_perf null)))               ,   ((a1.lv3_htd_perf_rag = a2.lv3_htd_perf_rag) or ((a1.lv3_htd_perf_rag null) , (a2.lv3_htd_perf_rag null)))               ,   ((a1.lv4_htd = a2.lv4_htd) or ((a1.lv4_htd null) , (a2.lv4_htd null)))               ,   ((a1.lv4_htd_format = a2.lv4_htd_format) or ((a1.lv4_htd_format null) , (a2.lv4_htd_format null)))               ,   ((a1.lv4_htd_perf = a2.lv4_htd_perf) or ((a1.lv4_htd_perf null) , (a2.lv4_htd_perf null)))               ,   ((a1.lv4_htd_perf_rag = a2.lv4_htd_perf_rag) or ((a1.lv4_htd_perf_rag null) , (a2.lv4_htd_perf_rag null)))               ,   ((a1.lv5_htd = a2.lv5_htd) or ((a1.lv5_htd null) , (a2.lv5_htd null)))               ,   ((a1.lv5_htd_format = a2.lv5_htd_format) or ((a1.lv5_htd_format null) , (a2.lv5_htd_format null)))               ,   ((a1.lv5_htd_perf = a2.lv5_htd_perf) or ((a1.lv5_htd_perf null) , (a2.lv5_htd_perf null)))               ,   ((a1.lv5_htd_perf_rag = a2.lv5_htd_perf_rag) or ((a1.lv5_htd_perf_rag null) , (a2.lv5_htd_perf_rag null)))               ,   ((a1.lv6_htd = a2.lv6_htd) or ((a1.lv6_htd null) , (a2.lv6_htd null)))               ,   ((a1.lv6_htd_format = a2.lv6_htd_format) or ((a1.lv6_htd_format null) , (a2.lv6_htd_format null)))               ,   ((a1.lv6_htd_perf = a2.lv6_htd_perf) or ((a1.lv6_htd_perf null) , (a2.lv6_htd_perf null)))               ,   ((a1.lv6_htd_perf_rag = a2.lv6_htd_perf_rag) or ((a1.lv6_htd_perf_rag null) , (a2.lv6_htd_perf_rag null)))               ,   ((a1.lv2_ytd = a2.lv2_ytd) or ((a1.lv2_ytd null) , (a2.lv2_ytd null)))               ,   ((a1.lv2_ytd_format = a2.lv2_ytd_format) or ((a1.lv2_ytd_format null) , (a2.lv2_ytd_format null)))               ,   ((a1.lv2_ytd_perf = a2.lv2_ytd_perf) or ((a1.lv2_ytd_perf null) , (a2.lv2_ytd_perf null)))               ,   ((a1.lv2_ytd_perf_rag = a2.lv2_ytd_perf_rag) or ((a1.lv2_ytd_perf_rag null) , (a2.lv2_ytd_perf_rag null)))               ,   ((a1.lv3_ytd = a2.lv3_ytd) or ((a1.lv3_ytd null) , (a2.lv3_ytd null)))               ,   ((a1.lv3_ytd_format = a2.lv3_ytd_format) or ((a1.lv3_ytd_format null) , (a2.lv3_ytd_format null)))               ,   ((a1.lv3_ytd_perf = a2.lv3_ytd_perf) or ((a1.lv3_ytd_perf null) , (a2.lv3_ytd_perf null)))               ,   ((a1.lv3_ytd_perf_rag = a2.lv3_ytd_perf_rag) or ((a1.lv3_ytd_perf_rag null) , (a2.lv3_ytd_perf_rag null)))               ,   ((a1.lv4_ytd = a2.lv4_ytd) or ((a1.lv4_ytd null) , (a2.lv4_ytd null)))               ,   ((a1.lv4_ytd_format = a2.lv4_ytd_format) or ((a1.lv4_ytd_format null) , (a2.lv4_ytd_format null)))               ,   ((a1.lv4_ytd_perf = a2.lv4_ytd_perf) or ((a1.lv4_ytd_perf null) , (a2.lv4_ytd_perf null)))               ,   ((a1.lv4_ytd_perf_rag = a2.lv4_ytd_perf_rag) or ((a1.lv4_ytd_perf_rag null) , (a2.lv4_ytd_perf_rag null)))               ,   ((a1.lv5_ytd = a2.lv5_ytd) or ((a1.lv5_ytd null) , (a2.lv5_ytd null)))               ,   ((a1.lv5_ytd_format = a2.lv5_ytd_format) or ((a1.lv5_ytd_format null) , (a2.lv5_ytd_format null)))               ,   ((a1.lv5_ytd_perf = a2.lv5_ytd_perf) or ((a1.lv5_ytd_perf null) , (a2.lv5_ytd_perf null)))               ,   ((a1.lv5_ytd_perf_rag = a2.lv5_ytd_perf_rag) or ((a1.lv5_ytd_perf_rag null) , (a2.lv5_ytd_perf_rag null)))               ,   ((a1.lv6_ytd = a2.lv6_ytd) or ((a1.lv6_ytd null) , (a2.lv6_ytd null)))               ,   ((a1.lv6_ytd_format = a2.lv6_ytd_format) or ((a1.lv6_ytd_format null) , (a2.lv6_ytd_format null)))               ,   ((a1.lv6_ytd_perf = a2.lv6_ytd_perf) or ((a1.lv6_ytd_perf null) , (a2.lv6_ytd_perf null)))               ,   ((a1.lv6_ytd_perf_rag = a2.lv6_ytd_perf_rag) or ((a1.lv6_ytd_perf_rag null) , (a2.lv6_ytd_perf_rag null)))               ,   ((a1.dif_from_peer_fivewkavg = a2.dif_from_peer_fivewkavg) or ((a1.dif_from_peer_fivewkavg null) , (a2.dif_from_peer_fivewkavg null)))               ,   ((a1.dif_from_peer_fivewkavg_format = a2.dif_from_peer_fivewkavg_format) or ((a1.dif_from_peer_fivewkavg_format null) , (a2.dif_from_peer_fivewkavg_format null)))               ,   ((a1.dif_from_peer_fivewkavg_perf = a2.dif_from_peer_fivewkavg_perf) or ((a1.dif_from_peer_fivewkavg_perf null) , (a2.dif_from_peer_fivewkavg_perf null)))               ,   ((a1.dif_from_peer_fivewk_perf_rag = a2.dif_from_peer_fivewk_perf_rag) or ((a1.dif_from_peer_fivewk_perf_rag null) , (a2.dif_from_peer_fivewk_perf_rag null)))               ,   ((a1.dif_from_peer_qtd = a2.dif_from_peer_qtd) or ((a1.dif_from_peer_qtd null) , (a2.dif_from_peer_qtd null)))               ,   ((a1.dif_from_peer_qtd_format = a2.dif_from_peer_qtd_format) or ((a1.dif_from_peer_qtd_format null) , (a2.dif_from_peer_qtd_format null)))               ,   ((a1.dif_from_peer_qtd_perf = a2.dif_from_peer_qtd_perf) or ((a1.dif_from_peer_qtd_perf null) , (a2.dif_from_peer_qtd_perf null)))               ,   ((a1.dif_from_peer_qtd_perf_rag = a2.dif_from_peer_qtd_perf_rag) or ((a1.dif_from_peer_qtd_perf_rag null) , (a2.dif_from_peer_qtd_perf_rag null)))               ,   ((a1.dif_from_peer_htd = a2.dif_from_peer_htd) or ((a1.dif_from_peer_htd null) , (a2.dif_from_peer_htd null)))               ,   ((a1.dif_from_peer_htd_format = a2.dif_from_peer_htd_format) or ((a1.dif_from_peer_htd_format null) , (a2.dif_from_peer_htd_format null)))               ,   ((a1.dif_from_peer_htd_perf = a2.dif_from_peer_htd_perf) or ((a1.dif_from_peer_htd_perf null) , (a2.dif_from_peer_htd_perf null)))               ,   ((a1.dif_from_peer_htd_perf_rag = a2.dif_from_peer_htd_perf_rag) or ((a1.dif_from_peer_htd_perf_rag null) , (a2.dif_from_peer_htd_perf_rag null)))               ,   ((a1.dif_from_peer_ytd = a2.dif_from_peer_ytd) or ((a1.dif_from_peer_ytd null) , (a2.dif_from_peer_ytd null)))               ,   ((a1.dif_from_peer_ytd_format = a2.dif_from_peer_ytd_format) or ((a1.dif_from_peer_ytd_format null) , (a2.dif_from_peer_ytd_format null)))               ,   ((a1.dif_from_peer_ytd_perf = a2.dif_from_peer_ytd_perf) or ((a1.dif_from_peer_ytd_perf null) , (a2.dif_from_peer_ytd_perf null)))               ,   ((a1.dif_from_peer_ytd_perf_rag = a2.dif_from_peer_ytd_perf_rag) or ((a1.dif_from_peer_ytd_perf_rag null) , (a2.dif_from_peer_ytd_perf_rag null)))) 

but it's taking absolutely forever finish, i've cancelled in hope can find quicker way of doing it, if possible.

for reference, contains 1.3 million rows, of half duplicates.

thanks.

try doing using group by:

delete mmi_owner.imart_tti_ret_my_customers a1     a1.rowid not in (select min(a2.rowid)                            mmi_owner.imart_tti_ret_my_customers a2                            group . . .                           ); 

i should note, though, deleting half rows in table can big operation. might consider:

create table t     select . . .     (select t.*, row_number() on (partition . . . order rowid) seqnum           t          ) t     seqnum = 1;  truncate table mmi_owner.imart_tti_ret_my_customers;  insert mmi_owner.imart_tti_ret_my_customers(. . . )     select . . .     t; 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -