Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 112537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:33:37+00:00 2026-05-11T02:33:37+00:00

I have these tables: Projects(projectID, CreatedByID) Employees(empID,depID) Departments(depID,OfficeID) Offices(officeID) CreatedByID is a foreign key

  • 0

I have these tables:

Projects(projectID, CreatedByID) Employees(empID,depID) Departments(depID,OfficeID) Offices(officeID) 

CreatedByID is a foreign key for Employees. I have a query that runs for almost every page load.

Is it bad practice to just add a redundant OfficeID column to Projects to eliminate the three joins? Or should I do the following:

SELECT *  FROM Projects P JOIN Employees E   ON P.CreatedBY = E.EmpID JOIN Departments D ON E.DepID = D.DepID JOIN Offices O     ON D.officeID = O.officeID WHERE O.officeID = @SomeOfficeID 

In application programming I ‘Write with best practices first and optimize afterwards’, but database administrators are always warning about the cost of joins.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:33:38+00:00Added an answer on May 11, 2026 at 2:33 am

    Denormalization has the advantage of fast SELECTs on large queries.

    Disadvantages are:

    • It takes more coding and time to ensure integrity (which is most important in your case)

    • It’s slower on DML (INSERT/UPDATE/DELETE)

    • It takes more space

    As for optimization, you may optimize either for faster querying or for faster DML (as a rule, these two are antagonists).

    Optimizing for faster querying often implies duplicating data, be it denormalization, indices, extra tables of whatever.

    In case of indices, the RDBMS does it for you, but in case of denormalization, you’ll need to code it yourself. What if Department moves to another Office? You’ll need to fix it in three tables instead of one.

    So, as I can see from the names of your tables, there won’t be millions records there. So you’d better normalize your data, it will be simplier to manage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 59k
  • Answers 59k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The solution can be read here: http://www.quirksmode.org/dom/inputfile.html in the last… May 11, 2026 at 9:03 am
  • added an answer Is this a case where a single controller might show… May 11, 2026 at 9:03 am
  • added an answer System.Reflection.MethodBase.GetCurrentMethod() Found it myself after some screwing around with the… May 11, 2026 at 9:03 am

Related Questions

I have these tables: Projects(projectID, CreatedByID) Employees(empID,depID) Departments(depID,OfficeID) Offices(officeID) CreatedByID is a foreign key
I have these tables: customer -------- customer_id int name varchar(255) order ----- order_id int
I have these 3 tables + data: items : itemId, itemName data: 1, my
I have tree tables, Customer, Invoice and InvoiceRow with the standard relations. These I
I have an SQL Server DB with a table with these fields: A bit
Suppose I have a dataset with those two immortal tables: Employee & Order Emp
Say that I have two tables like those: Employers (id, name, .... , deptId).
I have a table that contains tasks and I want to give these an
I have a database table (named Topics) which includes these fields : topicId name
well i have this messages table with sample values like these: msg_id recipient_id read

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.