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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:13:58+00:00 2026-05-21T11:13:58+00:00

I want to save permissions for both individual users, and user groups. In my

  • 0

I want to save permissions for both individual users, and user groups. In my mysql database, I have a permissions table where I store a permission name, and a permission id. I have a user table, where I store a username, password etc. which also contains an id, and I have a groups table which stores a group name and group id.

What would now be the most efficient option? To make 2 tables, one containing user permissions and one containing group permissions, so something like this:

int group id | int permission id

int user id | int permission id

or would it be better to have one table like this;

int id | int permission id | enum('user','group')
  • 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-21T11:13:59+00:00Added an answer on May 21, 2026 at 11:13 am

    I doubt there would be much of a performance difference between your two approaches; but, as with all performance and optimization questions, feelings and guesses don’t matter, only profiled results matter. Which one will be more efficient depends on your data, your database, your access patterns, and what “efficient” means (space? time? developer effort? final monetary cost?) in your context.

    That said, using two tables is a better structure as it allows you to have foreign keys from your group-permission table back to your group table and your user-permission table back to your user table. Even if it was faster in one table I’d still go with two: data integrity is more important than wasting a couple µs of processor time, I don’t see much point in quickly accessing unreliable or broken data.

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

Sidebar

Related Questions

i want to save a balance of user, in the user table . the
I want save the username and password when user login, and I added the
I want to save large amounts of text then display them (first in table
I want to save my countries local time(new zealand) in my database. I am
I have read-only access to a remote MySQL database, which contains a very large
I have read-only access to a remote MySQL database, which contains a very large
I have a problem with my android-app. I want to save a Data-list in
I have a security rule that a newly registered user has full permissions over
Project (id) Permission (project_id, user_id) When user's create a project, I want to ensure
How can I programmatically detect whether the current user has CREATE TABLE permissions in

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.