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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:28:48+00:00 2026-06-06T05:28:48+00:00

I have table with 300 000 records (MyISAM). I get record from this table

  • 0

I have table with 300 000 records (MyISAM). I get record from this table with this function:

public function loadRows() {
    if (!$this->result)
        die("Nothing found!");
    $this->rows = array();
    while ($r = mysql_fetch_array($this->result, MYSQL_ASSOC))
        $this->rows[] = $r;
    //mysql_free_result($this->result);
    return $this->rows;
}

The estimate time for showing 100 records from this table is 6 seconds, very slowly and the MEMORY used from this query is 512 MB. Where I’m wrong?

The query is:

SELECT i.* FROM inv i 
LEFT JOIN (inv_m im) ON (i.m_id = im.id)
LEFT JOIN (inv_f iff) ON (iff.num = i.num)
LEFT JOIN (temp_a ta) ON (ta.num = i.num)
WHERE i.vid = 1
AND iff.num IS NULL
AND ta.num IS NULL
LIMIT 100

For i.vid I show all records.

Declared INDEXES:

i.m_id INDEX

im.id PRIMARY KEY

iff.num INDEX

i.num INDEX

ta.num INDeX

THE EXPLAIN RESULT

id  select_type  table  type     possible_keys  key      key_len  ref                 rows    Extra
1   SIMPLE       i      ref      vid            vid      4        const               85343   Using where
1   SIMPLE       im     eq_ref   PRIMARY        PRIMARY  4        checksys_r1.i.m_id  1 
1   SIMPLE       iff    ref      num            num      182      checksys_r1.i.num   1       Using where
1   SIMPLE       ta     ref      num            num      194      checksys_r1.i.num   1       Using where
  • 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-06T05:28:49+00:00Added an answer on June 6, 2026 at 5:28 am

    Start with running:

    EXPLAIN SELECT i.* FROM inv i 
    LEFT JOIN (inv_m im) ON (i.m_id = im.id)
    LEFT JOIN (inv_f iff) ON (iff.num = i.num)
    LEFT JOIN (temp_a ta) ON (ta.num = i.num)
    WHERE i.vid = 1
    AND iff.num IS NULL
    AND ta.num IS NULL
    LIMIT 100
    

    look for things like a full row scan, file i/o, etc. Post the results here. Sometimes a table might need repairing as well.

    Also, is there any reason you’re using MyISAM over InnoDB?

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

Sidebar

Related Questions

I have a table with 300 000 records. In this table have duplicae rows
I have a table with more than 300,000 records, of size approximately 1.5 GB
Have a huge mysql table with like 300,000 records and wanted to page the
I have a database table with 300 000 records. The most common query done
I have table and this table contain result column with some entries. I just
I have table View with grouped style with three sections. Get information from dictionary
I have a 300.000 rows table; one of the columns is a varchar() but
I have table like this: id number value 1 300 233 2 343 434
I have a table which contains around 400 000 records and which gets called
I have a table with more than 300,000 rows (Total table size is 600mb+).

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.