refs #244, fix up query plan for applying refs on a secondary