BookmarkSubscribeRSS Feed
chaudharydeepak
Obsidian | Level 7

Hi Team,

 

I'm facing some issues while deleting of alerts form the PGAdim, DataBase is SharedServices and Schema is svi_alerts.


I'm having my script to delete the generated alerts.

 

When I'm trying to delete the record from the svi_alerts.tdc_alerting_event it's taking a lot of time to do so. I have noticed that it takes around 40-50 minutes to delete around 1000 records stored in the tdc_alerting_event table, and in the other table which are related to it, it takes a few seconds to do so.

 

Currently, I'm having around 190159 observations to delete. How can I do it in a minimum time period?

 

Below is my code to delete  records from svi_alerts schema:


delete from svi_alerts.tdc_contributing_object where alerting_event_id in (select alerting_event_id from svi_alerts.TDC_ALERTING_EVENT
where domain_id in ('Bill_Not_Generated', 'Outstanding_Payment_50_to_75',
'Outstanding_Payment_75_to_90','Outstanding_Payment_Above_90'));


delete from svi_alerts.tdc_scenario_fired_event where scenario_nm in ('Bill Not Generated in a Demand Cycle','Outstanding Payment against Bills >= 90%',
'Outstanding Payment against Bills Between 50% and 75%', 'Outstanding Payment against Bills Between 75% and 90%');

 

update svi_alerts.tdc_alerting_event set alert_id = null
where domain_id in ('Bill_Not_Generated', 'Outstanding_Payment_50_to_75',
'Outstanding_Payment_75_to_90','Outstanding_Payment_Above_90');


delete from svi_alerts.tdc_alert where domain_id in ('Bill_Not_Generated', 'Outstanding_Payment_50_to_75',
'Outstanding_Payment_75_to_90','Outstanding_Payment_Above_90');


delete from svi_alerts.tdc_alert_action where domain_id in ('Bill_Not_Generated', 'Outstanding_Payment_50_to_75',
'Outstanding_Payment_75_to_90','Outstanding_Payment_Above_90');


delete from svi_alerts.tdc_alerting_event where domain_id in ('Bill_Not_Generated', 'Outstanding_Payment_50_to_75',
'Outstanding_Payment_75_to_90','Outstanding_Payment_Above_90');

 

 

 

Thanks.

1 REPLY 1
Rachel_
SAS Employee

Hi,

 

I recommend that you open a technical support track for this issue, see this link: https://support.sas.com/en/technical-support/contact-sas.html#2f350546-5bf0-4b6e-8c04-11fa1bb1a29f

 

Thanks,

Rachel