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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:26:14+00:00 2026-05-24T09:26:14+00:00

For the problem below, I got the query working. But when I am running

  • 0

For the problem below, I got the query working. But when I am running the above query on a table having 2 million records, the MySQL process seems to hog the CPU with 100% utilization. I have been waiting for more than 15 minutes and still the query is running. Are there any performance tweaks which can improve this?

Mysql subquery help

select
    u.website,
    sum(e.ULVolume + e.DLVolume) as volume
from mytable e
left join mytable u on u.PID = e.PID and u.event ='update'
where e.Event = 'end'
group by 1;

System is running with Intel(R) Xeon(R) CPU X3430 @ 2.40GHz CentOS 5.6 with 8GB of RAM.

Update with EXPLAIN output:

*************************** 1. row ***************************
           id: 1   select_type: SIMPLE
        table: e
         type: ALL possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 2858631
        Extra: Using where; Using temporary; Using filesort
*************************** 2. row ***************************
           id: 1   select_type: SIMPLE
        table: u
         type: ALL possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 2858631
        Extra: 2 rows in set (0.00 sec)
  • 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-24T09:26:14+00:00Added an answer on May 24, 2026 at 9:26 am

    What indices do you have in your tables? Try prepending an EXPLAIN so see if indices are actually used.

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

Sidebar

Related Questions

The following query generates the error below in 10g: select DBMS_METADATA.GET_DDL('TABLE','TEST_TABLE','TEST') from dual; Got:
I'm having a problem with a InnoDB (table was initally MyISAM, but converted it
Problem solved, see below Question I'm working in Flex Builder 3 and I have
Got a little problem in my code, the query works fine if I manually
EDIT, Changed the code slightly based on answers below, but still haven't got it
i have got below code which is working fine: public abstract class Beverage {
The problem below is ralated to my previous question Converting static link library to
Solution to original problem (below) may have been discovered. I commented out <identity> ...
What is the problem below? routes.MapRoute( Default2, // Route name {controller}/{action}/{id}, // URL with
I need a simple SQL to accomplish the below: Problem: When a petrol bunk

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.