将数据从平面文件加载到 MySQL 数据库中,然后通过外键创建表之间关系的最快方法是什么?
例如......我有一个格式为:
[INDIVIDUAL] [POP] [MARKER] [GENOTYPE]
"INDIVIDUAL1", "CEU", "rs55555","AA"
"INDIVIDUAL1", "CEU", "rs535454","GA"
"INDIVIDUAL1", "CEU", "rs555566","AT"
"INDIVIDUAL1", "CEU", "rs12345","TT"
...
"INDIVIDUAL2", "JPT", "rs55555","AT"
我需要将其加载到四个表中:
IND (id,fk_pop,name)
POP (id,population)
MARKER (id,rsid)
GENOTYPE (id,fk_ind,fk_rsid,call)
具体来说,如何以一种可扩展的方式填充外键?这些数字在 1000 多个人的范围内,每个人都有 100 万多个基因型。