Closed isaacna closed 4 years ago
Can we combine minutes_item
and event_minutes_item
into just minutes_item
? Seems like there's some overlap between the two. Is there a reason why the two are separated?
Can we combine
minutes_item
andevent_minutes_item
into justminutes_item
? Seems like there's some overlap between the two. Is there a reason why the two are separated?
They are separated since event_minutes_item
refers to a specific instance of a use of a minutes_item
in an event
.
I think combining them could make a minutes_item
instance to get bloated and hard to link to vote
, because votes can happen on the same minutes_item
over multiple events with different decisions.
@JacksonMaxfield has a better understanding of the context so could give some more input
They are separated since
event_minutes_item
refers to a specific instance of a use of aminutes_item
in anevent
.I think combining them could make a
minutes_item
instance to get bloated and hard to link tovote
, because votes can happen on the sameminutes_item
over multiple events with different decisions.@JacksonMaxfield has a better understanding of the context so could give some more input
I see. I just worry about one query. In the details tab of the event details page. To display the details tab we would query event_minutes_item
using event_id
. For the event_minutes_item
that are matter-related, we have everything we need (matter_name
and matter_title
). But for non-matter event_minutes_item
we would have to query minutes_item
to get the name
field. That's maybe around 5 more queries. It's no big deal though.
But for non-matter
event_minutes_item
we would have to queryminutes_item
to get thename
field. That's maybe around 5 more queries. It's no big deal though.
If that's the case and too many joins are a concern then we could just add minutes_item_name
(and any other data needed for quick access) in the event_minutes_item
table like this:
minutes_item: {
minutes_item_id: str
minutes_item_name: str
}
Since this is a non-relational database I think having duplicated data is preferred over having excessive joins from a performance and design view.
Pull request recommendations:
vote
,minutes_item
, andevent_minutes_item
based on the front end query requirements. My logic behind nesting duplicate information was to only add information that needs to be accessed easily/without joins, such as nestingmatter_name
andmatter_title
directly intovote
.Thanks for contributing!