There are archive services provided by wM in WmMonitor/pub/monitor/archive and you can archive right from the lower left hand side of the WmMonitor page. We however found that if you are trying to archive large amounts of data, these are pretty inefficient. Because of confidentialilty reasons I can not share the source code of the stored procs we wrote, but I can tell you that we set the debug level to 10 on the IS and then ran the supplied archives to view the sql that was executed. Then we tuned those statements.
We also added an index for contextid and did not experience any problems. Additionally we have one for audittimestamp and another with the columns (instanceid, instanceiteration, stepid, and stepiteration). I can’t remember if either of these were supplied by wM or not however.