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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:40:26+00:00 2026-06-07T08:40:26+00:00

Say I have a table with 5000 records, and another table containing a list

  • 0

Say I have a table with 5000 records, and another table containing a list of 5 topics. Each topic is associated with 1000 records in the larger table – each comment has a ‘topic’ field which is a foreign key to the topics table.

For example, if the database stores all user’s comments on a website. There will be 1000 comments on topic A, 1000 on topic B etc…

If I want to obtain all the comments on a particular topic, I would have to write a query to obtain the correct 1000 rows out of a possible 5000.
What if instead I created 5 tables, each table storing comments about a particular topic only.

Assuming there would never be more than maybe 40 topics, is this a sensible approach to database design? I can’t see any obvious disadvantages, but it seems like it will produce faster query results.

  • 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-06-07T08:40:30+00:00Added an answer on June 7, 2026 at 8:40 am

    Don’t go down that road.
    It will not be faster, but it will soon become a maintenance nightmare because

    • you’ll have to add a new table for every new topic
    • you’ll have to do a lot of UNION ALL … style queries if you want comments for all topics,
      and you’ll have to modify every one of them if the list of topics changes (although this can be mitigated by clever usage of views)
    • you’ll have to drop a table every time you want to get rid of a topic

    Just put all comments in a single table, add a foreign key with an index, and you’ll be fine (5000 records is a very small amount of data, BTW – RDBMS systems usually handle millions of rows without any problems).

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

Sidebar

Related Questions

I have a mysql database table filled with 1000+ records, lets say 5000 records.
Say I have two tables, user and comment . They have table definitions that
Let’s say I have table/list like this n=3 in this case, but n can
Say I have a table of apples (apple_id). And for each apple I have
Lets say I have table with following columns 1. Client - string. 2. Profit
Lets say I have table named Place with columns: placeId int not null auto_increment,
Lets say I have table with ID int, VALUE string: ID | VALUE 1
Say I have a table that goes clockwise like this: 2 1 3 0
Say I have a table: <table id=table1 border=1> <tr> <td id='id1' style=width:200px></td> <td id='id2'
Say I have this table schema. ID AccNo Amount Say I have this data

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.