Deleted Added
sdiff udiff text old ( 2665:a124942bacb8 ) new ( 2716:b9114064d77a )
full compact
1# Copyright (c) 2003-2004 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 86 unchanged lines hidden (view full) ---

95 rn_project VARCHAR(100) NOT NULL,
96 rn_date TIMESTAMP NOT NULL,
97 rn_expire TIMESTAMP NOT NULL,
98 PRIMARY KEY (rn_id),
99 UNIQUE (rn_name,rn_sample)
100 ) TYPE=InnoDB''')
101
102 #
103 # The stat table gives us all of the data for a particular stat.
104 #
105 # COLUMNS:
106 # 'stat' is a unique identifier for each stat to be used in other
107 # tables for references.
108 # 'name' is simply the simulator derived name for a given
109 # statistic.
110 # 'descr' is the description of the statistic and what it tells

--- 84 unchanged lines hidden (view full) ---

195 # -5: maximum value
196 # -6: underflow
197 # -7: overflow
198 # 'y' is used by a VECTORDIST and the VECTOR2D to describe the second
199 # dimension.
200 # 'run' is the run that the data was generated from. Details up in
201 # the run table
202 # 'tick' is a timestamp generated by the simulator.
203 # 'data' is the actual stat value.
204 #
205 # INDEXES:
206 # 'stat' is indexed so that a user can find all of the data for a
207 # particular stat. It is not unique, because that specific stat
208 # can be found in many runs and samples, in addition to
209 # having entries for the mulidimensional cases.
210 # 'run' is indexed to allow a user to remove all of the data for a
211 # particular execution run. It can also be used to allow the
212 # user to print out all of the data for a given run.
213 #
214 self.query('''
215 CREATE TABLE data(
216 dt_stat SMALLINT UNSIGNED NOT NULL,
217 dt_x SMALLINT NOT NULL,
218 dt_y SMALLINT NOT NULL,
219 dt_run SMALLINT UNSIGNED NOT NULL,
220 dt_tick BIGINT UNSIGNED NOT NULL,
221 dt_data DOUBLE NOT NULL,
222 INDEX (dt_stat),
223 INDEX (dt_run),
224 UNIQUE (dt_stat,dt_x,dt_y,dt_run,dt_tick)
225 ) TYPE=InnoDB;''')
226
227 #
228 # Names and descriptions for multi-dimensional stats (vectors, etc.)
229 # are stored here instead of having their own entry in the statistics
230 # table. This allows all parts of a single stat to easily share a
231 # single id.
232 #

--- 135 unchanged lines hidden (view full) ---

368
369 self.query('''
370 DELETE subdata
371 FROM subdata
372 LEFT JOIN data ON sd_stat=dt_stat
373 WHERE dt_stat IS NULL''')
374
375 self.query('''
376 DELETE events
377 FROM events
378 LEFT JOIN runs ON ev_run=rn_id
379 WHERE rn_id IS NULL''')
380
381 self.query('''
382 DELETE event_names
383 FROM event_names
384 LEFT JOIN events ON en_id=ev_event
385 WHERE ev_event IS NULL''')