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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:39:57+00:00 2026-05-14T03:39:57+00:00

I have 2 tables that their rows have one on one relation.. For you

  • 0

I have 2 tables that their rows have one on one relation..
For you to understand the situation, suppose there is one table with user informations
and there is another table that contains a very specific informations and each user can only link to one these specific kind of informations ( suppose second table as characters )

And that character can only assign to the user who grabs it, Is it against the rules of designing clean databases to hold the relation key in both tables?

User Table: user_id, name, age, character_id

Character Table: character_id, shape, user_id

I have to do it for performance, how do you think about it?

  • 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-14T03:39:58+00:00Added an answer on May 14, 2026 at 3:39 am

    Yes, I’d say it was against the rules of designing clean databases, as the data you have is repeated, therefore you have to actively maintain two sets of data at all times for fear they are out of sync. If you don’t do this, you can’t trust the data. 🙂

    As a side note: You say you’re doing this for performance reasons? What benefits have you seen of doing this? As regardless of which table you access the data from, you should find (with proper indexes) that there is very little difference? It might be you are fixing the wrong issue here and maybe there are other things to look at first (like indexes, improving your queries etc).

    Edit: Selecting free characters should be easy enough as you would get rid of the character_id from the users table and only have user_id in the characters one:

    Users:  user_id, name, age
    Characters:  character_id, shape, user_id
    

    Then you would be able to do some queries like these:

    //something like this to query for free characters.
    SELECT * FROM characters WHERE user_id IS NULL;
    
    // To access a list of a users characters, you could do something like this:
    SELECT * FROM characters WHERE user_id = 42;
    
    // More information about the user, while still grabbing character info.
    SELECT * FROM characters AS c INNER JOIN users AS u ON u.user_id = c.user_id WHERE u.user_id = 42;
    

    Or is there more about your model that I’m maybe missing with this? (As I don’t pretend to know your database layout 😉 ). I’m assuming a one-to-many relationship, as it does appear to be that way (one user can have many characters).

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

Sidebar

Related Questions

Suppose I have two tables, one with blog posts and another with readers and
In my database I have tables that define types for example Table: Publication Types
I have several related database tables and I would like to treat their rows
I have two tables that are joined together. A has many B Normally you
I have some tables that I build as a part of my report rollup.
I have some tables that represent various types. They usually just consist of an
Ok, I have two tables that I am joining and doing a select on
I have some nested tables that I want to hide/show upon a click on
I have three tables like that: Articles IdArticle Title Content Tags IdTag TagName ContentTag
I have a few tables that have similar fields but not exactly the same.

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.