for $i at $p in //entry[phraseme[text() = "Ad0194"] and selected[text() = "yes"]]
It’s often beneficial to avoid nested predicated. Does the following version give you better results?
//entry[phraseme/text() = "Ad0194" and selected/text() = "yes"]
Beside that, feel free to send us the query info (the output of the Info View), as it often indicates potential for additional optimizations.