Preferred order of upload CONTAINS operands

Mark Taylor M.B.Taylor at
Mon Jul 11 11:58:13 CEST 2016

Dear colleagues,

this is a request for input on a suggestion to change the template
ADQL query that topcat suggests to users for making positional
upload crossmatch queries.  If you run a TAP service it may be
relevant to you.

Currently if you select the "Upload|Upload Join" item from the
Examples menu at the bottom of topcat's TAP window, you see
something like this:

      TOP 1000
      FROM hipparcos.main AS db
      JOIN TAP_UPLOAD.t1 AS tc
      ON 1=CONTAINS(POINT('ICRS', db.raj2000, db.dej2000),
                    CIRCLE('ICRS', tc.RA2000, tc.DEC2000, 5./3600.))

The idea is that the user takes the general form of this example
and tweaks it a bit for their own purposes.

It turns out that when applied to the TAPVizieR service, such
queries fail to take into account appropriate indices, and hence
run slowly.  Gilles Landais (CDS) has therefore requested that I
change the order of this suggested query so it reads instead:

      TOP 1000
      FROM TAP_UPLOAD.t1 AS tc
      JOIN hipparcos.main AS db
      ON 1=CONTAINS(POINT('ICRS', tc.raj2000, tc.dej2000),
                    CIRCLE('ICRS', db.RA2000, db.DEC2000, 5./3600.))

I've got no objection to doing this, but I don't know if it's
possible/likely/known to have a negative effect on other TAP services
out there.  If you run a TAP service can you comment on whether
this looks like a bad idea?  Is there an "obviously" more sensible
order here?  If I get no response, I will probably change it as
Gilles requests.  If there is general disagreement, I will probably
leave it as it is.

In the longer term I hope this issue will go away, since I've been
arguing that ADQL 2.1 should contain some officially recommended ADQL
syntax for executing positional sky crossmatches, so that we can
avoid this kind of guesswork.


Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor at +44-117-9288776

More information about the dal mailing list