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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:46:16+00:00 2026-05-26T17:46:16+00:00

I have a pretty basic question that confuses me for some strange reason. I

  • 0

I have a pretty basic question that confuses me for some strange reason.

I have two tables, one is the table Pages and the other is the Menus. I am wondering, what is the benefits of using another table for mapping? Below is the two implementations that I am thinking:

Two implementations

The only difference I see is the way that I search.
For example in the first implementation:

a) if I want all the pages of a specific menu, I’ll query all the page_ids of the specific menu name and I’ll join them with the id of the table Pages (which is why I think this implementation is more slow).

b) if I want all the menus of a specific page I will search all the menus that have the page_id of the specific page.

In the second implementation is more typical and straightforward (and with more joins).

I think that the second implementation is the right one because it is faster (I guess, because it queries only between ids which is indexes instead of searching in menus names as I mentioned above in a)).

Or is there any other particular reason? Are these two designs identical in a matter of what they can accomplish or are there any other limitations in the first design and I always should choose the second one?

  • 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-26T17:46:17+00:00Added an answer on May 26, 2026 at 5:46 pm

    The two options are NOT identical; the latter is the correct choice to use in a many-to-many design. Using a joining table means that you can have many pages (A, B, C) and many menus (1,2,3) and you can associate a set of menus with a set of pages (yielding A1, A2, A3, B1, B2, B3, C1, C2, C3).

    The first design assumes that any given menu can only have 1 page associated with it. Menu 1 can only be associated with one page (will it be A, B, or C?). To associate the same menu with multiple pages, you’ll need to have one row in your menu table for each associated page.

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

Sidebar

Related Questions

This is a pretty basic question. Since browsers have a culture setting that the
I have a pretty basic question that I imagine would require a join to
Another basic Rails question: I have a database table that needs to contain references
This a pretty basic question. Let's say I have this iPhone/iPad app that, at
Pretty basic question: I have a model x that has_many y, and model y
this should be a pretty basic question. I would like to have some html
Pretty basic programming question, I know PHP have a function for it, but does
I have a user control that is pretty basic. It contains several TextBox controls,
I have an ASP.NET site that I'm developing. The layout is pretty basic. The
I have a pretty basic question: In GAE, if I use memcache to store

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.