Colin Law wrote in post #1097732:
> On 18 February 2013 22:51, masta Blasta <lists@ruby-forum.com> wrote:
>> I have a model Report, and a model ReportComponent. ReportComponent
>> belongs to Report, and Report has_many components. Both tables have some
>> commons fields such as organization_id, manager_id etc, and of course
>> their own unique fields. There is no hard business reason for having
>> these duplicate fields, but they help with join queries and DB
>> performance.
>
> Don't repeat the fields, that is not good. Can you explain why you
> need them? There will almost certainly be a better way.
>
> Colin
Most commonly is to make our jobs easier when analyzing the DB data.
JOIN queries become a bit simpler. Yes it slightly defeats the purpose
of a relational database, but we haven't had any issues so far. Just the
convenience of having those variables available right away is enough to
bend some of the rules.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment