[TAP] MAXREC

Douglas Tody dtody at nrao.edu
Mon Apr 20 15:02:21 PDT 2009


On Mon, 20 Apr 2009, Patrick Dowler wrote:
> 
> A small question about using MAXREC=0. The draft states that
> this produces an output table if the query is (will be) otherwise
> successful, eg a valid query.  Should this be a valid query (meaning
> it tests the actual ADQL query, which is probably only do-able by
> running it) or just a valid request?

The primary motivation for MAXREC was to limit the output of a query,
e.g., amount of data to be transferred over the network.  If a valid
query overflows MAXREC then it is not considered an error, and a
valid table should be returned with overflow indicated (whether in
TAP or one of the other DAL2 interfaces).

MAXREC=0 is a special case which was invented for TAP to force a
null query so that only table metadata is returned.  Whether or
not the query should actually be executed has never been carefully
considered before.

If all we want to do is get table metadata for a single table
then it would seem to be a waste to actually execute the query.
The service could treat this as a special case.  It might not be that
simple however as for anything other than "SELECT *" type queries
of a single table one might not know the fields of the output table
without executing the query.

> The complication with the valid query interpetation, as I see it, is
> that practically one would have to at least create uploaded tables,
> which means at least transferring and parsing the input VOTables and
> then parsing and running the query on the database, as many checks
> and errors will be deferred to that stage.

It would seem to be an unlikely case that someone would upload a table
if they are doing a MAXREC=0 query.  Perhaps we should keep it simple
and state that the output will be as if the query had been executed,
but it is allowed for the service implementation to streamline or
avoid query execution in this case.  This would give the service
some scope for optimizing such queries if it wants to.  Hence some
execution errors might not be seen when MAXREC=0 is specified.

> With PQL a "valid request" is more or less synonymous with "valid
> query" so it is not much of an issue there.

Param queries can have many of the same execution errors as ADQL
queries, and can have table uploads and so forth.  So the issue
is pretty much the same in both cases.  The main simplification is
that input is limited to a single data table in the FROM clause (not
counting uploads), and the queries themselves are much more constrained
hence probably easier for the service to analyze and optimize.

 	- Doug



More information about the dal mailing list