create night batch ( store procedure , function ) to handling the huge amount of data . Try to schedule it properly to avoid facing the low performance during online process