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

The Archive Base Latest Questions

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

I have a bulk query with subquery. My query works fine when I run

  • 0

I have a bulk query with subquery. My query works fine when I run it on development server, but when I’ve try it pn the live server, the query takes too much time to produce an output. I think it’s because of a big data on the live server. Can anyone help me on how to index query on MySQL so that it will lessen the time execution.

Here is my query:

SELECT prd.fldemployeeno AS Empno,
       (SELECT fldemployeename FROM tblprofile prf WHERE prf.fldemployeeno = prd.fldemployeeno LIMIT 0,1) AS Empname,
       '01' AS `Week`,
       COUNT(DISTINCT isAud.fldid) AuditedFiles, 
       COUNT(qua.seqid) ErrorCount, 
       COUNT(DISTINCT qua.fldid) OrdersWithError
  FROM tbldownloadITL dwn 
 INNER JOIN tblproductionITL prd 
    ON dwn.fldid = prd.fldglobalid
 INNER JOIN (SELECT p.fldemployeeno,fldglobalid,p.fldstarttime,COALESCE(q.fldstarttime,p.fldstarttime) `AuditDate`
               FROM tblproductionitl p
               LEFT JOIN tblqualityaudit q
                 ON p.fldemployeeno=q.fldemployeeno
                AND p.fldstarttime=q.fldprodstarttime
                AND p.fldglobalid=q.fldid
              WHERE p.fldprojectgroup='PROJGROUP') temp
    ON prd.fldglobalid=temp.fldglobalid
   AND prd.fldemployeeno=temp.fldemployeeno
   AND prd.fldstarttime=temp.fldstarttime
 INNER JOIN tblisauditedITL isAud 
 USING (fldid)
  LEFT JOIN tblqualityaudit qua 
    ON qua.fldid = dwn.fldid
   AND qua.fldbusunit = dwn.fldbusunit
   AND qua.fldprojectGroup = dwn.fldprojectGroup
   AND qua.fldemployeeno = prd.fldemployeeno
   AND qua.fldprodstarttime = prd.fldstarttime
   AND qua.flderrorstatus != 'NOT ERROR' 
  LEFT JOIN tblerrorcategory 
 USING (flderrorcategoryid) 
  LEFT JOIN tblerrortypes
 USING (flderrortypeid)
 WHERE dwn.fldbusunit = 'BUSUNIT'
   AND dwn.fldprojectGroup = 'PROJGROUP'
   AND temp.AuditDate BETWEEN '2011-07-29 00:00:00' AND '2011-07-29 23:59:59'
 GROUP BY prd.fldemployeeno 
 ORDER BY Empname

Here is also the description of the query:

enter image description here

  • 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-26T02:21:44+00:00Added an answer on May 26, 2026 at 2:21 am

    I would suggest installing Sphinx on the your server if you have the access. That way you can have an indexed resource at your finger tips for extremely fast searching, on top of that you can add the execution of what is called a ‘delta’ index to allow for real time updating of your mysql database. It is highly customizable. Hopefully this will help you out.

    http://sphinxsearch.com/

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

Sidebar

Related Questions

If I run the following query in SQL Server 2000 Query Analyzer: BULK INSERT
I have a query which is working fine: BULK INSERT ZIPCodes FROM 'e:\5-digit Commercial.csv'
We currently have a company email server with Exchange, and a bulk email processing
I have a bulk insert command that I am issuing through C#. Is the
Have you ever seen any of there error messages? -- SQL Server 2000 Could
I have a bulk of data in my app. I need it in case
I have a query like this: use DataIncremental go DECLARE @row_terminator CHAR; SET @row_terminator
I have a complicated query built up based on a users profile, I start
I currently have an SQL query which is currently called multiple times like this
I have a function that receives a query as parameter (as clob type) and

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.