Hi Mike,
Thanks for the question. The timing difference comes down to the request for the extra (ra,dec) values in the query. In the first case, the database is doing an "Index Only" scan for the query and retrieves the value directly from the index. When you add the (ra,dec) values it still has to do the same filtering on the parallax but then access the full table for the additional columns but then has to process a check for NaN on each value.
The fastest way I found to exclude the NaN is to instead set an upper bound on the parallax as a real value, e.g. "where parallax > 500.0 and parallax < 1000.", this still permits the index-only scan of the table and returns almost instantly. I hope this helps, let us know if you still have problems or questions.
Cheers,
-Mike