Next, the optimizer prefers single string values (although range queries are generally supported as well). In your query, it might help to first convert your ids to strings, such as shown here:
let $ids := for $i in 1 to 10 return string($i) for $i in //*:molecule[@*:id = $ids]/*:identifier[@*:convention="iupac:smile"] return $i
Thanks! That was the solution!
"Query executed in 45.11 ms."
Patrick