Prag
you provided basically no useful information that could be used to determine why your code executes slow and what to do about it.
Please do your due diligence and provide the source code and some time measurements of the execution steps.
Based on your problem description so far, a valid recommendation would also be to ditch whatever code you wrote and simply have the replication put the data directly into the second schema as well.
Open ended questions like this just waste everybody's time as no proper analysis can take place at all.
- Lars