Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DB Design - Store summary data at master table, instead of deriving it

John-APEXOct 13 2020

Hi All,
I am trying to prepare DB design for APEX application. Requirement is as follows.
In Departments IR page, users are asking below columns

  1. Number of employees in each department (Department may or may not have employees)
  2. Primary Location for Department (Department can have multiple addresses and addresses are stored in other table, along with primary flag)
  3. Alternative Manager's Email Address for Department (alt_manager_id column, this is optional column and refers to employees table)
    I can implement these requirements using either inline sub queries or using OUTER JIONs. But, these approaches will have performance impact as the data grows (like 100s of thousands of rows). So, my question is, is it ok to store these data directly at "Departments" table and update "Departments" table when child tables gets updated. Basically, I am trying to store summary data at master table, instead of deriving it as on when needed from child tables. Is this considered bad practice? Is it ok to implement such DB design?
    Thank you
This post has been answered by Mike Kutz on Oct 13 2020
Jump to Answer
Comments
Post Details
Added on Oct 13 2020
5 comments
156 views