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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:16:48+00:00 2026-05-29T21:16:48+00:00

This is possible a problem what i lost more time to think how to

  • 0

This is possible a problem what i lost more time to think how to do correct, thinking in the best optimized way to do.

I have a table “Contents”, and need to add the option to associate multiple “hashtags” or “tags” or “keywords” to the contents, for example, the content like “fried potatos with ketchup” have the “keys”: “potato”, “ketchup” and “fried”.

And when i make a search by a word, for example “potato”, i need to show the contents that have in it tags this word.

The question is, what its the best structure to do this, thinking in the speed of results because the content table is a MyISAM mith more than 30 Millon rows.

I think in this:

Make 2 more tables, “contents_hashtags” (id(INT11), content_id(INT11), hashtag_id(INT11)) and “hashtags” (id(INT11), hashtag(VARCHAR(40))) the 2 tables in InnoDB

When the user create/modify the table content, I search in the hashtags table and get the IDs, if a hashtag that don’t exist, create it in the table hashtag, if exists, get the ID, using this IDs create the inserts in the table contents_hashtas asociating contents <-contents_hashtas-> hashtahs

In the search, make the JOINS (LEFT/RIGHT/INNER dude..) and make a search by LIKE ?? by exact(hashtag = “XXX”) or FULL TEXT SEARCH?

Is this method correct/fast? I dont know how run this with a big row counts and big traffic..

  • 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-29T21:16:51+00:00Added an answer on May 29, 2026 at 9:16 pm

    Actually, one extra table is enough

    “hashtags” (id(INT11), hashtag(VARCHAR(40))), content_id(int11))

    Now you can simply add hastag’s by name. To get all hashtags for a content, use

    SELECT hashtag FROM hashtable WHERE content_id=$content_id
    

    TO add a remove a hashtag, delete it using its id or hashtag itself. To get content for specific hastags, just use

    SELECT ct.* from hashtable ht, contenttable ct WHERE ht.hashtag=$hastag and ct.id=ht.content_id
    

    and so on

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

Sidebar

Related Questions

Is this possible? I want to have the To:, Body, and an Attachment all
Possible Duplicate: Lost the IntelliSense SQL Server 2008 Intellisense problem In SQL Server 2008
Has anyone attempted this? Is it possible, and if so, what kind of problems
Is this possible? I am looking forward to a tutorial which explains the steps
Is this possible? I had troubles with SVN clients not being able to access
Is this possible? I can't find it anywhere.
Is this possible? Or would I miss something? (Fixtures,..?) Because: When I use autotest
Is this possible? I am creating a single base factory function to drive factories
Is this possible? I've followed the instructions from here ( http://www.jetbrains.net/confluence/display/TCD4/Setting+up+an+External+Database#SettingupanExternalDatabase-MicrosoftSQLServer2005 ) but I
Is this possible: myList = [] myList[12] = 'a' myList[22] = 'b' myList[32] =

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.