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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:26:15+00:00 2026-06-16T13:26:15+00:00

I am fetching data from multiple table having 600 thousand of records. But is

  • 0

I am fetching data from multiple table having 600 thousand of records. But is taking a lot and lot of time to fetch it.
Please let me know how can i shorten the time to fetch it.
I also have used the LIMIT case, but still no improvement.

My query is:

SELECT DISTINCT 
tf_history.thefind_id, 
tf_product.product_id, 
tf_product.`name`, 
tf_product.product_url, 
tf_product.image_tpm, 
tf_product.image_thefind, 
tf_product.image_accuracy, 
(SELECT MIN(tf_h.price)
 FROM tf_history AS tf_h
 WHERE tf_h.thefind_id = tf_history.thefind_id) as price, 
oc_product.price AS priceTPM
FROM tf_product
LEFT JOIN tf_history ON tf_product.product_id = tf_history.product_id 
                     AND tf_product.thefind_id = tf_history.thefind_id
LEFT JOIN oc_product ON tf_product.product_id = oc_product.product_id 
WHERE  tf_product.product_id = @product_id

MY table:

tf_history

history_id  int(11) NO  PRI     auto_increment
thefind_id  int(11) NO          
product_id  int(11) NO          
price   decimal(15,4)   NO          
date    datetime    NO          

AND
tf_product

thefind_id  int(11) NO  PRI     auto_increment
product_id  int(11) NO          
name    varchar(255)    NO          
store_id    int(11) NO          
product_url varchar(255)    NO          
image_tpm   varchar(255)    NO          
image_thefind   varchar(255)    NO          
image_accuracy  int(3)  NO          
date    datetime    NO

But when i use this query:

SELECT * from tf_history

i got the result in 0.641s, then what can be the issue?
When there was less record the, first query was running smoothly.

  • 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-16T13:26:16+00:00Added an answer on June 16, 2026 at 1:26 pm

    using index will solve your problem.

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

Sidebar

Related Questions

Now a lot of scripts to facebook-style fetching data from url, but all of
I'm fetching some data from an MSSQL table using the mssql_fetch_object, but the text
I'm having trouble fetching data from my table with the following. $email = $_POST['email'];
I am having 2 issues with fetching data from doctrine: Select records from start
My problem is like this question but I am fetching data from different table:
I am fetching data from database and i am showing it in multiple select
I'm fetching data from Mysql from table person(id, name, email). The table has many
I am fetching data from facebook and during the time of fetching the data,
i am having problems while fetching data from kml file. geoXml.parse(http://localhost/maps/phpmysqlajax_genkml.kml); error in console
I am fetching data from a sql query into an asp table in cs

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.