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

  • Home
  • SEARCH
  • 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 787603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:13:46+00:00 2026-05-14T21:13:46+00:00

For each ad, I allow users to choose up to 5 tags. Right now,

  • 0

For each ad, I allow users to choose up to 5 tags. Right now, in my database, I have it like…

Posting_id     TagID
    5            1
    5            2 
    5            3
    6            5
    6            1

But i was thinking if I should make it like…

    Posting_id     TagID
    5              1 2 3 
    6              5 1

Then first option is much easier to insert and retrieve data. But if I have 100 posts with 3 tags each, that’s 300 rows…so ALOT more rows

The second option requires using explode() impode(), etc but it is much cleaner.

Which option should I do and why? thanks!

EDIT: The first way is better!

  • 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-14T21:13:46+00:00Added an answer on May 14, 2026 at 9:13 pm

    Use the first option because the second option makes it difficult to index the TagID column effectively. If you ever want to query your data on for a specific numeric value stored in the TagID column (and I’m betting you will), you’ll get poor performance out of the second option.

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

Sidebar

Related Questions

For each user, I want to allow them to choose their preferences, such as
I have a topics app that allows users to create topics. For each individual
So I have an rails admin system that will allow a user to choose
Let's imagine I have a database and I want to programatically allow the user
I've got a number of users, each with the website page like http://www.mysite.com/folder/artist_id.php?id=33 The
So in our database right now, we can store text, and text only. So,
Each of our users is assigned to a primary organizational unit (OU) based on
Each book can have many authors. And each author can author many books. class
Each Lucene doc is a recipe, and each of these recipes have ingredients. Im
I have a database that has two tables, one of which contains a foreign

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.