Skip to content

Conversation

dinesh-beehyv
Copy link
Contributor

Below changes has been done to inprove the performance
Approach for Performance Improvement:
Fetching data using a JDBC connection instead of Data Nucleus.
Optimized Query Execution:
Using prepared statements for executing database queries.
Ensuring all operations are properly closed after a successful database interaction.
Query Optimization:
Updated the existing query to fetch all the required columns from 9 tables used for target file generation.
DTO Usage:
Storing query results in a DTO format.
Applied the Builder design pattern in the DTO class for efficient data handling.
Integration with Method:
Updating all columns in the generateFreshCall method.

try {
timeSlots = subscriptionTimeSlotService.findTimeSlotsForSubscriptionsById(subscriptionIds);
try {
timeSlots = subscriptionTimeSlotService.findAllTimeSlots();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why looking for all Time slots here?

"WHERE ts.subscriptionId IN (" + idsString + ")";
"FROM nms_subscriptions_time_slot ts " +
"LEFT JOIN nms_subscriptions s ON ts.subscription_id = s.id;";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This join isn't efficient. Right now, time_slot has little data because it's in the pilot phase, but it will grow to millions soon. We might also get unnecessary old data. Add a WHERE condition to filter only recent data (e.g., last 72 weeks, exclude deactivated or completed ).

@Kantas2601
Copy link
Contributor

We should run this new method alongside the old way of creating the target file in production, not replace it immediately. We can't risk missing a single day's call. Use the API to generate the target file, but will not send it to Hungama. we have analyze the results first, and if everything works well, then switch to the new method completely.

@atishbeehyv123 please suggest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants