Hi ogonzalesdiaz,
Counting in progress is similar to the personalization step. It counts the recipients but also ensures that the expected count is the same as the actual count. If the count is misaligned, an error will be thrown, and the delivery will fail.
The count could fail due to personalizations being called within the delivery that incorrectly leverage a 1-N table and cause the number of targeted recipients to be inflated.
The preparation step heavily interacts with the database. So, if you want to improve this step, there are numerous optimizations:
1) Check the current delivery content and ensure that any personalization or count requests within the content are properly joined on keys and not doing full table scans
2) Ensure referenced tables are indexed
3) Ensure that the database cleanup workflow, maintenance scripts, and temp space are cleaned
If you are still unable to determine the problem, I recommend turning on SQL logging to see what queries are being executed and then either reach out to your database administrator or to Campaign Support, who can review the queries when the delivery is executed. This way, they can see if an inefficient query is being executed or perhaps there is another conflicting query from another workflow that is locking the table and causing delays in the count.
Regards,
Craig