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 690575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:27:02+00:00 2026-05-14T02:27:02+00:00

I am a recent college graduate and a new hire for software development. Things

  • 0

I am a recent college graduate and a new hire for software development. Things have been a little slow lately so I was given a db task. My db skills are limited to pet projects with Rails and Django. So, I was a little surprised with my latest task.

I have been asked by my manager to subclass Person with a ‘Parent’ table and add a reference to their custodian in the Person table. This is to facilitate going from Parent to Form when the custodian, not the Parent, is the FormContact.

Here is a simplified, mock structure of a sql-db I am working with. I would have drawn the relationship tables if I had access to Visio.

We have a table ‘Person’ and we have a table ‘Form’. There is a table, ‘FormContact’, that relates a Person to a Form, not all Persons are related to a Form. There is a relationship table for Person to Person relationships (Employer, Parent, etc.)

I’ve asked, “Why this couldn’t be handled by a query?” Response, Inefficient. (Really!?!)

So, I ask, “Why not have a reference to the Form? That would be more efficient since you wouldn’t be querying the FormContacts table with the reference from child/custodian.” Response, this would essentially make the Parent is a FormContact. (Fair enough.)

I went ahead an wrote a query to get from non-FormContact Parent to Form, and tested on the production server. The response time was instantaneous. SOME_VALUE is the Parent’s fk ID.

SELECT FormID 
FROM FormContact 
WHERE FormContact.ContactID 
    IN (SELECT SourceContactID 
        FROM ContactRelationship
        WHERE (ContactRelationship.RelatedContactID = *SOME_VALUE*) 
            AND (ContactRelationship.Relationship = 'Parent'));

If I am right, “This is an unnecessary change.” What should I do, defend my position or should I concede to the managers request?

If I am wrong. What is my error? Is there a better solution than the manager’s?

  • 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. Editorial Team
    Editorial Team
    2026-05-14T02:27:02+00:00Added an answer on May 14, 2026 at 2:27 am

    First things first, your query could use some reworking. Rather than subselects, try using a join:

    SELECT FormID
    
    FROM FormContact fc
    
    JOIN ContactRelationship cr on cr.SourceContactID = fc.ContactID 
                                   and cr.Relationship = 'Parent'
    
    WHERE cr.RelatedContactID = @parent_id
    

    Secondly, the issue you’re dealing with is normalization vs. performance. From a purity perspective, yes, your solution is “more correct” (as you aren’t duplicating data, which eliminates the possibility for the disparities in the duplicated data causing conflicts and aberrant behavior), but pure normalization is not always the wisest course of action.

    Normalization can induce performance penalties, especially in larger data sets. These penalties have to be weighed alongside the benefits from normalization to see which side “wins”.

    That being said, I can’t see how joining the Person table again on the ParentID column (I’m assuming that’s what you’d be adding) would provide a performance boost over the join listed above, assuming that the columns in question are properly indexed.

    If the query above works for you and you do rigorous performance testing to show that it’s valid, take it to your manager and ask for his input. Because you’re new and fresh out of college, be very willing to defer to your manager’s judgment and wishes on this one. There will be much bigger battles to fight in the future.

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

Sidebar

Related Questions

When interviewing college coops/interns or recent graduates it helps to have a Java programming
A recent task I have to figure out, gives me some hard time thinking
A recent Windows Update or software installation seems to have broken my one week
In several recent answers I see this code given as the way to retrieve
Recent JVM's have a lot of XX parameters for garbage collection (see here for
I recent came across Javascript templates and have become quite intrigued. I am building
During recent development I've discovered infinite loop in application I'm working on. First error
A recent homework assignment I have received asks us to take expressions which could
In recent attempts to understand the ASP.NET GridView I have seen mst examples make
Recent conversations with colleagues have produced varying points of view on this matter. What

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.