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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:18:26+00:00 2026-05-22T02:18:26+00:00

I have a 2 row table pertaining of a number, and that numbers cube.

  • 0

I have a 2 row table pertaining of a number, and that numbers cube. Right now, I have about 13 million numbers inserted, and that’s growing very, very quickly.

Is there a faster way to output simple tables quicker than using a command like SELECT * FROM table?


My second question pertains to the selection of a range of numbers. As stated above, I have a large database growing extremely fast to hold numbers and their cubes. If you’re wondering, I’m trying to find the 3 numbers that will sum up to 33 when cubed. So, I’m doing this by using a server/client program to send a range of numbers to a client so they can do the equations on said range of numbers.

So, for example, let’s say that the first client chimes in. I give him a range of 0, 100. He than goes off to compute the numbers and report back to tell the server if he found the triplet. If he didn’t the loop will just continue.

When the client is doing the calculations for the numbers by itself, it goes extremely slow. So, I have decided to use a database to store the cubed numbers so the client does not have to do the calculations. The problem is, I don’t know how to access only a range of numbers. For example, if the client had the range 0-100, it would need to access the cubes of all numbers from 0-100.

What is the select command that will return a range of numbers?


The engine I am using for the table is MyISAM.

  • 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-22T02:18:27+00:00Added an answer on May 22, 2026 at 2:18 am

    If your table “mytable” has two columns

    number     cube
      0         0
      1         1
      2         8
      3         27
    

    the query command will be (Assuming the start of the range is 100 and the end is 200):

    select number, cube from mytable where number between 100 and 200 order by number;
    

    If you want this query to be as fast as possible, make sure of the following:

    • number is an index. Thus you don’t need to do a table scan to find the start of your range.
    • the index you create is clustered. Clustered indexes are way faster for
      scans like this as the leaf in the index is the record (in comparison, the leaf in a
      non-clustered index is a pointer to the record which may be in a completely different
      part of the disk). As well, the clustered index
      forces a sorted structure on the
      data. Thus you may be able to read all 100
      records from a single block.

    Of course, adding an index will make writing to the table slightly slower. As well, I am assuming you are writing to the table in order (i.e. 0,1,2,3,4 etc. not 10,5,100,3 etc.). Writes to tables with clustered indexes are very slow if you write to the table in a random order (as the DB has to keep moving records to fit the new ones in).

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

Sidebar

Related Questions

I have a 10 million+ row table that looks like this: id | time_read
I have a table row, and within that, I have a td (whatever it
I have a table row that needs to be hidden when the anchor with
I have a table row that has the error message in it. <tr runat=server
We have a 10 thousand row table that has just 2 columns, a primary
I have a row in an html-table that contains only images. (this happens to
We have a very large (10million+) row table stored in MySql using the InnoDB
Scenario I have a 10 million row table. I partition it into 10 partitions,
I have table row with click event button with click event, that button is
In R, I have a 1-row table. How do I convert that to a

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.