|
|
|
|
File: [lscsoft] / glue / src / conf / db2 / segment.sql
(download)
Revision: 1.14, Tue Nov 6 15:55:20 2007 UTC (2 years ago) by duncan Branch: MAIN CVS Tags: stringsearch-s4-2008-04-09-v2, stringsearch-s4-2008-04-09-v1, s5ringdown_090220, s5_ringdown_090331, s5_highmass_cbc_311008, s5_highmass_cbc_20081211, s5_highmass_20081202, s5_highmass_171108, s5_high_mass_20080716, s5_high_mass_20080715, s5_high_mass_20080702, s5_followup_20090331, s5_followup_20090325, s5_followup_20090305, s5_followup_20090304, s5_followup_20090219, s5_followup_20090204, s5_2yr_lv_lowcbc_20090303, s5_2yr_lv_lowcbc_20081207, s5_2yr_lv_lowcbc_20081009a, s5_2yr_lv_lowcbc_20081009, s5_2yr_lv_lowcbc_20081008, s5_2yr_lv_lowcbc_20081005, s5_2yr_lv_lowcbc_20080729, s5_2yr_lv_lowcbc_20080625, s5_2yr_lowcbc_script_20071221, s5_2yr_lowcbc_20071220, s5_2yr_followup_20081218, release-1-18, release-1-17, release-1-16, mdc_eobnr_v2_20090119, mdc_eobnr_v1_20081204, m10_20090208, highmass_cbc_20090327, highmass_cbc_20090323, highmass_cbc_20090129, highmass_cbc_20090113, highmass_cbc_20090109, highmass_cbc_20090107, highmass_cbc_20090106, glue_head_test_20071211, LIGO_P070085_00_Z, HEAD Changes since 1.13: +15 -0 lines added GPL v3 to all files |
-- This file is part of the Grid LSC User Environment (GLUE)
--
-- GLUE is free software: you can redistribute it and/or modify it under the
-- terms of the GNU General Public License as published by the Free Software
-- Foundation, either version 3 of the License, or (at your option) any later
-- version.
--
-- This program is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-- details.
--
-- You should have received a copy of the GNU General Public License along
-- with this program. If not, see <http://www.gnu.org/licenses/>.
CREATE TABLE segment
(
-- A "segment" is a time interval which is meaningful for some reason. For
-- example, it may indicate a period during which an interferometer is locked.
-- Database which created this entry
creator_db INTEGER NOT NULL WITH DEFAULT 1,
-- Unique process ID of the process which defined this segment
process_id CHAR(13) FOR BIT DATA NOT NULL,
-- Unique segment ID
segment_id CHAR(13) FOR BIT DATA NOT NULL,
-- INFORMATION ABOUT THIS SEGMENT
-- Segment start and end times, in GPS seconds.
start_time INTEGER NOT NULL,
start_time_ns INTEGER,
end_time INTEGER NOT NULL,
end_time_ns INTEGER,
-- Activity bit for segment. If zero then this time has been analyzed but
-- the segment should not be applied. If positive then this segment should
-- be added to the list of segments (by a union), if negative then this
-- segment should be removed from the list of segments (by a negation and an
-- intersection).
active INTEGER NOT NULL,
-- Science segment identification number. If this is a science segment
-- created by the online segment publish script, this should contain the
-- valued stored in the channel IFO-SV_SEGNUM, otherwise it should be NULL
segnum INTEGER,
-- Insertion time (automatically assigned by the database)
insertion_time TIMESTAMP WITH DEFAULT CURRENT TIMESTAMP,
CONSTRAINT segment_pk
PRIMARY KEY (segment_id, creator_db),
CONSTRAINT segment_fk_pid
FOREIGN KEY (process_id, creator_db)
REFERENCES process(process_id, creator_db)
ON DELETE CASCADE
)
-- The following line is needed for this table to be replicated to other sites
DATA CAPTURE CHANGES
;
-- Create an index based on time
CREATE INDEX segment_ind_time ON segment(start_time,start_time_ns,end_time,end_time_ns)
;
CREATE INDEX segment_ind_stime ON segment(start_time)
;
CREATE INDEX segment_ind_etime ON segment(end_time)
;
-- Create an index based on segment number
CREATE INDEX segment_ind_segnum ON segment(segnum)
;
| admins@gravity.phys.uwm.edu |
Powered by ViewCVS 0.9.2 |