From 31f83bb9c41d5cc81f2f684a04a854f6cf6688f1 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Tue, 24 Mar 2020 17:04:38 +0000 Subject: [PATCH 1/2] Increase default query limit to 50,000 from 10,000 --- app/dao/notifications_dao.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index d142fb595..4e882c455 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -297,7 +297,7 @@ def _filter_query(query, filter_dict=None): @statsd(namespace="dao") -def delete_notifications_older_than_retention_by_type(notification_type, qry_limit=10000): +def delete_notifications_older_than_retention_by_type(notification_type, qry_limit=50000): current_app.logger.info( 'Deleting {} notifications for services with flexible data retention'.format(notification_type)) From e5b6fa2143f7391958a4b57cc265f229c140c9bf Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 25 Mar 2020 08:08:33 +0000 Subject: [PATCH 2/2] Reduce log messages. --- app/dao/notifications_dao.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index 4e882c455..6d8ad7d4b 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -372,19 +372,14 @@ def insert_notification_history_delete_notifications( "timestamp_to_delete_backwards_from": timestamp_to_delete_backwards_from, "qry_limit": qry_limit } - current_app.logger.info( - f"Start executing insert_notification_history_delete_notifications for input params {input_params}" - ) + db.session.execute(drop_table_if_exists) - current_app.logger.info('Start executing select into temp table') db.session.execute(select_into_temp_table, input_params) result = db.session.execute("select * from NOTIFICATION_ARCHIVE") - current_app.logger.info('Start executing insert into history') db.session.execute(insert_query) - current_app.logger.info('Start executing deleting notifications') db.session.execute(delete_query) db.session.execute("DROP TABLE NOTIFICATION_ARCHIVE")