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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:06:43+00:00 2026-05-28T14:06:43+00:00

I want to create a database structure that will has good efficiency. Now database

  • 0

I want to create a database structure that will has good efficiency. Now database looks like that:

data (type:primary; data is unique because miliseconds) | category | price | plenty different columns of data
201201231100121234                                      |   3      |   0   |
201201231100121249                                      |   14     |   5   |
  1. Let say I have about 15 main categories so I thought to keep every record in specific table, depends from category. So if a user will do a search in specific category then query will come to only for all records in specific table. So it is good solution, right?

  2. But what if user wants to see all records from all categories sort by data? Probably I need to use UNION, but the speed search using a temporary table will be a lot worse than keep all categories in one table, right? Probably I allow user search only the chosen category, not in all categories.

  3. The last question is about sort. When a user uses sort with “data” column like that: “sort by data asc LIMIT 0,10” or “sort by data desc LIMIT 0,10” then search is fast, because data is unique. But when user wants to sort by price (that can’t be unique) then there is no solution to the query can has more performance? Any solution for that?

  • 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-28T14:06:43+00:00Added an answer on May 28, 2026 at 2:06 pm

    so I thought to keep every record in specific table

    No – this is a bad idea, it places a lot more complexity on the code managing the data and doesn’t give any measurable performance benefit compared with a properly indexed table. Certainly there might be a case for varying the structure if different categories have different sets of fields associated with them – but this would be best represented by maintaining the common field set in a single table with the category specific fields in other tables using a 1:1 non-oblig join.

    Your 3rd point seems a bit confused. There’s nothing to stop you adding indexes on other columns, however, using your example, suppose you’ve got 20 records each with the max value for price – which ones do you expect to see when you SORT BY price DESC LIMIT 0,10?

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

Sidebar

Related Questions

I want to create an SQL script that creates a database. Right now, I
Essentially, I would like to create a database structure that allows for classifying an
Ok, so I want to create a database with all the data of the
I want to create a large database of GPS coordinates that can be queried
I want to create a new row in my database on a table that
i want to create tabs according to data from MySQL database using php for
I have a table in database which has following structure(data) : +--------------------------+ Organization +--------------------------+
I want to create a simple web app that will have a connection from
I would like to create an nsobject that will have all of my methods
I want to create a database in which there's an n x m relationship

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.