在MySQL中,在一个表中有500列是否很好? 行将每天增加,最大行数将小于或等于100万。,在一个表中有500列是否很好?
只给一个简短的,这些都是我的列标题
表名:process_detail id, process_id, item_id, item_category, attribute1,attribute2,attribute3,...,attribute500,user_id1_update_time,user_id2_update_time,user_id1_comments,user_id2_comments
所有属性都用VARCHAR最大长度30但小于30
和我有25个item_categories。
我应该创建一个单独的表,如“process_detail”,或者我应该创建多个表categorywise像category1_process_detail,category2_process_detail,..,category25_process_detail
每个item_category具有不同数量的列,一些将有200列和一些将只有50列。可以说category1将有200列,category2将有50列。
category1中的某些列不会在category2中。
process_id1中的item_ids可能出现在process_id2中。良好表现的最佳方法是什么?请adivce。
我建议你阅读本:http://www.studytonight.com/dbms/database-normalization.php – Doomenik
你应该实现EAV实体附加值像 processDetails(ID,PROCESS_ID,ITEM_ID,item_category) 属性(ID,标题) processToAttributes(ID,PROCESS_ID,attribute_id,ATTRIBUTE_VALUE) 所以在这种方式,将相对于标准化水平得到优化3 –
@NaveedRamzan,谢谢,但属性在application.we编辑字段不能让它们在属性表中预定义。 – davidb