[英]Create a new column or create a new table in database
I have a dataBase with table schedule
and many data with this properties like id
title
type
description
and foreigns keys called day_id
event_id
我有一个带有表schedule
的数据库,并且有许多具有此属性的数据,例如id
title
type
description
和称为day_id
event_id
键
The day_id
make a relationship with table schedule_day
that contains the property id
and date
day_id
与包含属性id
和date
表schedule_day
建立关系
What's the best design and performance search for this two cases: 这两种情况的最佳设计和性能搜索是什么:
1- Keep different tables, a table day and a table schedule with foreign key to day 1-保留不同的表,一个表日和一个表日程,并带有外键
or 要么
2- Create a column date in schedule table e remove the shedule_day
table 2-在时间表表中创建列日期e删除shedule_day
表
If schedule_day contains only two columns and has no chance to add column in future then it should be replaced by adding one column into schedule table. 如果schedule_day仅包含两列,并且以后没有机会添加列,则应通过在调度表中添加一列来替换它。
In terms of performance, join of two table require time. 在性能方面,两个表的联接需要时间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.