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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:50:32+00:00 2026-05-23T14:50:32+00:00

I have two tables: Avatars: Id | UserId | Name | Size ———————————————– 1

  • 0

I have two tables:

Avatars:
Id     | UserId    | Name            | Size
-----------------------------------------------
1      | 2         | 124.png         | Large
2      | 2         | 124_thumb.png   | Thumb

Profiles:
Id     | UserId    | Location    | Website
-----------------------------------------------
1      | 2         | Dallas, Tx  | www.example.com

These tables could be merged into something like:

User Meta:
Id     | UserId    | MetaKey        | MetaValue
-----------------------------------------------
1      | 2         | location       | Dallas, Tx
2      | 2         | website        | www.example.com
3      | 2         | avatar_lrg     | 124.png
4      | 2         | avatar_thmb    | 124_thumb.png

This to me could be a cleaner, more flexible setup (at least at first glance). For instance, if I need to allow a “user status message”, I can do so without touching the database.

However, the user’s avatars will be pulled far more than their profile information.

So I guess my real questions are:
What king of performance hit would this produce?
Is merging these tables just a really bad idea?

  • 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-23T14:50:33+00:00Added an answer on May 23, 2026 at 2:50 pm

    In this case, it looks like users may have one large avatar and one small avatar, so why not make those columns on the user table?

    We have a similar type of table at work that probably started with good intentions, but is now quite the headache to deal with. This is because it now has 100s of different “MetaKeys”, and there is no good documentation about what is allowed and what each does. You basically have to look at how each is used in the code and figure it out from there. Thus, figure out how you will document this for future developers before you go down that route.

    Also, to retrieve all the information about each user it is no longer a 1-row query, but an n-row query (where n is the number of fields on the user). Also, once you have that data, you have to post-process each of those based on your meta-key to get the details about your user (which usually turns out to be more of a development effort because you have to do a bunch of String comparisons). Next, many databases only allow a certain number of rows to be returned from a query, and thus the number of users you can retrieve at once is divided by n. Last, ordering users based on information stored this way will be much more complicated and expensive.

    In general, I would say that you should make any fields that have specialized functionality or require ordering to be columns in your table. Since they will require a development effort anyway, you might as well add them as an extra column when you implement them. I would say your avatar pics fall into this category, because you’ll probably have one of each, and will always want to display the large one in certain places and the small one in others. However, if you wanted to allow users to make their own fields, this would be a good way to do this, though I would make it another table that can be joined to from the user table. Below are the tables I’d suggest. I assume that “Status” and “Favorite Color” are custom fields entered by user 2:

    User:
    | Id    | Name      |Location    | Website          | avatarLarge | avatarSmall
    ----------------------------------------------------------------------
    | 2     | iPityDaFu |Dallas, Tx  | www.example.com  | 124.png     | 124_thumb.png
    
    
    UserMeta:
    Id     | UserId    | MetaKey        | MetaValue
    -----------------------------------------------
    1      | 2         | Status         | Hungry
    2      | 2         | Favorite Color | Blue
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have two Tables: Document: id, title, document_type_id, showon_id DocumentType: id, name Relationship: DocumentType
I have two tables: Table 1: ID, PersonCode, Name, Table 2: ID, Table1ID, Location,
I have two tables. Table Emp id name 1 Ajay 2 Amol 3 Sanjay
I have two tables: t1 ____________ projectID userID projectExpiration t2 ____________ usrID subscriptioID subscriptionExpiration
I have two tables: COUNTRY ------------- id name NEIGHBOUR ------------- id id_country1 id_country2 id_country1
I have two tables, like these: Table People: VARCHAR Name INTEGER Age Table Message
I have two tables ITEMS : id, name CATEGORIES: items_id, category I need to
I have two tables: Users and Profiles. A user may have a profile and
I have two tables: Table1: id attr1 fk1(Table2) fk2(Table2) Table2: id name I want
I have two tables named MEMBER - columns id(primary key), name, email & TOPICS

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.