Employee Checkin is taking too long time to be saved

Employee Checkin is taking too much time to be saved for my client, client’s employees are around 6000 and Employee Checkin records are almost 1200000, this line is taking around 7 seconds to execute in employee_checkin.py file

def validate(self):
		validate_active_employee(self.employee)
		self.validate_duplicate_log()
		self.fetch_shift()

self.validate_duplicate_log() this function is taking much time. Is there any solution for this.

Thanks

Hi @Mubashir,

Just for the suggestion:

first improve the performance of the validate_duplicate_log() function inemployee_checkin.py file like
→ Make sure the database table is properly indexed for efficient querying.
→ Optimize the code and queries used in the function.
→ Process the records in batches instead of all at once.
→ Implement caching to store and reuse validation results.
→ Consider asynchronous processing to avoid blocking the user interface.
→ If the data volume is large and continuously growing, shard the database into multiple instances.

Note: Depending on your architecture

Thank You!

This performance issue is fixed after:

Ref:

1 Like

Hi @rucha_mahabal thanks again for your reply, this issue is fixed with this update. Thank you.

1 Like