The only thing that happens in the database when a sale expires is a reset of prices without the sale applied.
How many products are in your database?
Do you use a lot of attributes?
Do you have attribute-dependent pricing ?
What happens if you (do a database backup first and then) go to Admin->Tools->Store Manager and click on Update all Products Price Sorter ?
If this step is the problem, well, you might wait a long time.
24 hours seems absurd. Especially since PHP is likely to time out after 5 minutes, or even 30 seconds depending on the server configuration.




