[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

MySQL performance issue with large table.

Asked by intlgd in MySQL Server, SQL Query Syntax

Tags: MySQL

Hello Experts,

I have a table with 6 million records in it and growing. The database is INNODB and all search fields are indexed. I originally had the table with lots of joins, but have since removed all joins. It's a self-sustained table. There are about 10 fields, most of which are varchar. I have tried two different indexes (hash and btree). I've tried two different approaches, indexes with all search fields in order as the query may be executed and indexing each field. The indexing definitely made a difference, but it still takes about 9 seconds to execute one query. This bottleneck is killing my application. Any thoughts on how I can improve upon this?

I'm using Hibernate and Spring, but the queries below are being executed directly against the database without using Spring/Hibernate.

Have I hit a MySQL wall? Do I need to consider Oracle?

Thanks,

J
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
TABLE WITH 6.5 MILLION RECORDS:
 
CREATE TABLE BTD_WEEKLY_ROLLUP
(
  WEEKLY_ROLLUP_KEY Bigint(20) NOT NULL,
  COUNT_TYPE_CODE Varchar(32) NOT NULL,
  MON_ID Int NOT NULL,
  HIER_CODE Varchar(32),
  RESOURCE_ID Varchar(32),
  SUPER_COMPO_NAME Varchar(255),
  TRUE_COMPO_NAME Varchar(64),
  BUG_STATUS_CODE Varchar(32),
  BUG_FOUND_IN_CODE Varchar(32),
  SEVERITY_CODE Int,
  WEEKLY_ROLLUP_VAL Int NOT NULL,
  WEEK_DATE Datetime NOT NULL
)
;
 
 
QUERY WHICH TAKES 11+ seconds to execute:
 
SELECT WEEK_DATE, COUNT_TYPE_CODE, SUM(WEEKLY_ROLLUP_VAL) FROM BTD_WEEKLY_ROLLUP
WHERE MON_ID = 20469
AND HIER_CODE = 'NSSTG'
AND BUG_STATUS_CODE IS NULL
AND BUG_FOUND_IN_CODE IS NULL
AND SEVERITY_CODE IS NULL
AND (WEEK_DATE >= '2009-01-01' AND WEEK_DATE <= '2009-07-01')
GROUP BY WEEK_DATE, COUNT_TYPE_CODE
ORDER BY WEEK_DATE ASC;
[+][-]08/12/09 09:06 AM, ID: 25080103Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: MySQL Server, SQL Query Syntax
Tags: MySQL
Sign Up Now!
Solution Provided By: alainbryden
Participating Experts: 2
Solution Grade: B
 
[+][-]08/12/09 09:10 AM, ID: 25080135Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/12/09 09:38 AM, ID: 25080384Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08/12/09 09:40 AM, ID: 25080395Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/12/09 11:37 AM, ID: 25081452Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/12/09 12:20 PM, ID: 25081885Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/12/09 04:43 PM, ID: 25084350Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625