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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:43:54+00:00 2026-06-06T09:43:54+00:00

I have a large database with two tables: stat and total. The example of

  • 0

I have a large database with two tables: stat and total.

The example of the relation is the following:

STAT:

|   ID   |  total event |
+--------+--------------+
|   7    |  2           |
|   8    |  1           |

TOTAL:

|ID | Event        |
+---+--------------+
| 7 | "hello"      |
| 7 | "everybody"  |
| 8 | "hi"         |

This is a very simplified version; also consider that STAT table could have 500K records, and for each STAT I can have about 200 TOTAL rows.

Currently, if I run a simple SELECT query in table TOTAL the system is terribly slow.

Could anyone help me with some advice for the creation of the TOTAL table? Is it possible to say to MySQL that the id column is already sorted so that there is no reason to scan all the rows till the end where, for example, id=7?

  • 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-06T09:43:57+00:00Added an answer on June 6, 2026 at 9:43 am

    You can add an index, and furthermore you can partition your table.

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

Sidebar

Related Questions

I have two very large enterprise tables in an Oracle 10g database. One table
I have a very large database (~100Gb) primarily consisting of two tables I want
I have a SQL database with two tables like this: Users Id (PK) Name
I face the following problem. I have two large tables with about 80.000 records
I am trying to import data from a large database. I have two tables
I have a large database with over 150 tables that I've recently been handed.
Here is the main problem. I have very large database (25,000 or so) of
This is for an upcoming project. I have two tables - first one keeps
I have two tables: Invoice (ID, InternalPrice, ExternalPrice) InvoiceSummary (InvoiceID, Variance ) In this
In my database I have two closely related tables. There is a frequently called

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.