Designing your own offline database tables

A good starting point for building your own tables is of course the following section of the User's Manual: Here is a short summary of some important issues one needs to bear in mind while designing tables:

Reserved Words

Avoid the use of MySQL and ORACLE reserved words for your table and column names. You should be able to find a complete list on Google:

Indexed tables

Make sure that your main table has an index key pointing towards the sequence number. This will allow MySQL to optimize queries. The command to create a table looks like:
     create table YOURTABLE(
              SEQNO integer,
              .....
              YOURCOLUMNS   type,
              .....
              index (SEQNO));
If this table is going to be supported by the DatabaseInterface, it needs an associated Validity Range Table, created like:
     create table  YOURTABLEVLD(
              SEQNO integer not null primary key auto_increment,
              TIMESTART datetime not null,
              TIMEEND datetime not null,
              DETECTORMASK tinyint(4),
              SIMMASK tinyint(4),
              TASK integer,
              AGGREGATENO integer,
              CREATIONDATE datetime not null,
              INSERTDATE datetime not null);


Comments: Mark Dierckxsens (mdier@bnl.gov)
Last modified: Mon Nov 15 11:34:03 2004