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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:24:07+00:00 2026-06-15T04:24:07+00:00

In my website I have a forum in which you can start a thread,

  • 0

In my website I have a forum in which you can start a thread, respond to one, delete your posts, report others’ posts, etc.

I decided to make an abstraction and to create a table called activity which would store the user_id, time (the fields every activity has in common), and the type of activity (thread, response, report, deletion) and the effective_id (the id that would correspond to respective table).

At the beginning this seemed like a great idea, because it would help to avoid redundancy and would make it easier to look up what a certain user has done without having to ask each table. But at the same time, this abstraction results in more complicated queries (e.g. having to use INNER JOIN in almost every simple query) and now I’m having trouble with more complex queries.

So my question is: did I take the right decision? Is in a real-life environment so important to have a perfect database even if it results in very expensive queries?

  • 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-15T04:24:08+00:00Added an answer on June 15, 2026 at 4:24 am

    The whole point of relational database system is to relate data (by separating entities in the correct tables), by doing so you introduce joins. This is normal and a good database design technique.

    A lot of database beginners try to avoid joins and add attributes from various entities to avoid having to do a INNER join, but this is not a proper technique and will bite you in the long run. Joins are there for a reason and should be used when you need to relate data.

    In your example you are in essence creating a “log” file. The activity on your application is simply a log to what the user is doing. Ask yourself, what would be better a log for a post, a log for a report, a log for deletions, a log for, in addition many log tables or one simple log table with a referenceID as to what activity the user initiated (this in fact is a FK). The answer is you’d want one log table that contains a foreign key have you of what the user initiated (a delete, a add, a flag, etc).

    The question you want to ask yourself though is, why are you displaying the activity information when a user simply wants to get this data. You can always keep this data normalized as you have but only select it when you need it. I don’t understand why you are joining to this activity table.

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

Sidebar

Related Questions

I have a system in which users can register with my forum via the
I have a database for a forum-like website. It has a 'users' table, which
On my website, I have a button which when clicked displays a feedback form
I have a form where depending on the website's brand one of two input
You have to have a form on your website for people to send an
I have made a navbar at the top of my website which contains multiple
I have a HTML form that uses unobtrusive validation in my website which is
I have a Java class which can be called from shell. (via java [command][options])
On my forum-based website, I have a link below every post for reporting spam
I am going to host a website which is forum related (programmed in php

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.