optimized obtain tx ids process