ADQL/XML non compliance with SQL?
Martin Hill
mchill at dial.pipex.com
Mon Feb 9 06:29:42 PST 2004
I'm pretty sure this is correct (standard) SQL:
SELECT * FROM table t WHERE t.i=t.z AND t.i=t.a AND t.b=t.e
I would expect that an SQL database will look at those ANDs and work out which
is the quickest set to solve first depending on internal indexing.
However ADQL/XML (and SADQL v1.0!) only allow pairwise ANDs. When transforming
ADQL/XML -> Database SQL, we must use brackets around each boolean construct,
because we don't know what the original priority might have been, ie:
WHERE (f OR f) AND (t OR t) = f
is different from
WHERE f OR (f AND t) OR t = t
and as soon as we use brackets we lose multiple Unions/Intersections.
We could work with the backend ADQL/XML->Database SQL transformations to fix
this, but I think it might be better if the schema represented the SQL
'properly'. Particularly as currently I expect it's the ADQL/SQL -> ADQL/XML
parser that is prioritising the brackets, rather than the backend.
So can I propose that IntersectionSearch and UnionSearch take 2..unbounded
arguments?
On another point, isn't XOR a standard SQL boolean operator?
Cheers,
Martin
--
Martin Hill
Software Engineer
AstroGrid @ ROE
Tel: +44 7901 55 24 66
www.astrogrid.org
More information about the voql
mailing list