- 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 spatial queries using ra,dec limits, it is
inefficient to use the constraints directly, e.g.:
- SELECT ... FROM PhotoTag
- WHERE (ra between ra1 AND ra2) AND
(dec between dec1 AND dec2).
The efficient way to do spatial queries is with the built-in functions
that we provide, which use our HTM (Hierarchical
Triangular Mesh) spatial indexing to speed up the search by an order of magnitude:
- SELECT ... FROM PhotoTag p, fGetObjFromRectEq(ra1,dec1,ra2,dec2) r
- WHERE p.objid=r.objid
Please see the Optimizing Queries page
and the Sample Queries page for more information.
To find out more about the database schema use the Schema Browser.
For an introduction to the Structured Query Language (SQL), please see
Searching for Data How-To tutorial.
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.