Obscore: obs_id not null requirement

Markus Demleitner msdemlei at ari.uni-heidelberg.de
Fri Mar 4 12:25:41 CET 2022


Dear DAL, Dear DM,

[followups suggested to DAL]

On page 20 for version 1.1, Obscore requires the obs_id column to be
NOT NULL.

This has operational consequences, for instance because Mark Taylor's
stilts taplint duly tries to verify this, issuing a query like

  SELECT TOP 1 obs_id FROM ivoa.ObsCore WHERE obs_id IS NULL

Since obs_id is rather meaningless for almost all of the tables
contributing to my obscore view, and there aren't any "recommended"
queries using it, I don't have an index on that column.  Since (I
think) there are no obs_id NULLs, this means it has to sequentially
scan all the tables, hitting close to 100 million rows.

Of course, I could add such an index, but since ~50 tables
contribute, that would be significant work for both me and the
computer (at least postgres can't have indexes on views). I am hence
wondering:  What is the purpose of the non-null constraint on obs_id?
Is there actually a use case that exploits that, any known software
that would break with obs_id NULL?

Or, really: Can we drop that constraint?

Thanks,

          Markus



More information about the dal mailing list