Please note:
To be fair to other users, queries run from SkyServer search
tools are restricted in how long they can run and how much output they
return, by timeouts and row limits. Please see the Query Limits help page.
To run a query that is not restricted by a timeout or number of rows returned, please use the CasJobs batch query service.

For an introduction to the Structured Query Language (SQL), please see
the
Searching for Data How-To tutorial.
In particular,
please read the Optimizing Queries
section. If your query is timing out or running much slower than you
think it should, please see also the
the BookMark Lookup bug section of the SQL Intro.