MySQL Forums
Forum List  »  InnoDB

Re: performance issue
Posted by: Rick James
Date: March 12, 2015 10:45PM

select count(id_text_meta_data), text_topic_text_medium_id_text_medium
without a GROUP BY does not make sense. Rethink the query.

IN ( SELECT ... )
has terrible performance characteristics. Try to turn it into a JOIN. However, you will then run into troubles with join-group-inflation. That is where a JOIN creates more rows than are desired for the GROUP BY, hence leading to a COUNT() or SUM() with an inflated value.

Can you describe what the query is trying to do?
Can you describe it from the inside out?

(Sorry, I don't see a simple transformation to make the query faster; perhaps your reply will help.)

What kind of stuff is in flag1..5? 5 Boolean values? More than than? I am looking for shrinking the fields and/or moving them to a separate table.

> PRIMARY KEY (`id_file_control`,`text_meta_data_id_text_meta_data`),

* A PRIMARY KEY is a UNIQUE key
* id_file_control is declared AUTO_INCREMENT, which usually indicates you want unique values.
These are fighting each other. Can you explain your choice of PK?

The other is similarly puzzling.

(Your column names are painfully verbose.)

You have a redundant index on `text_meta_data_id_text_meta_data`.

Options: ReplyQuote


Subject
Views
Written By
Posted
1802
February 24, 2015 06:01AM
1015
February 27, 2015 01:02AM
1138
February 28, 2015 11:50PM
1050
March 04, 2015 08:04PM
1121
March 10, 2015 01:49AM
Re: performance issue
995
March 12, 2015 10:45PM
1021
March 15, 2015 12:28AM


Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.