您可能想从考虑如何分析数据开始。
假设您的分析需要了解实验名称、实验复制编号、内部复制(例如,在每个时间点,每个处理测量 3 个“相同”受试者)。所以你的数据库架构可能是这样的:
experiments
exp_id int unsigned not null auto_increment primary key,
exp_name varchar(45)
other fields that any kind of experiment can have
replicates
rep_id int unsigned not null auto_increment primary key,
exp_id int unsigned not null foreign key to experiments
other fields that any kind of experiment replica can have
subjects
subject_id int unsigned not null auto_increment primary key,
subject_name varchar(45),
other fields that any kind of subject can have
observations
ob_id int unsigned not null auto_increment primary key,
rep_id int unsigned not null foreign key to replicates,
subject_id int unsigned not null foreign key to subjects,
ob_time timestamp
other fields to hold the measurements you make at each timepoint
如果您有内部复制,则需要另一个表来保存内部复制/主题关系。
不要担心你的数百万行。只要您明智地索引,就不可能有任何问题。但是,如果情况变得更糟,您始终可以将观察表(可能是最大的)分区为rep_id
.