MySQL Forums
Forum List  »  Performance

Re: 100% cpu usage on single cpu core
Posted by: Gus Lopez
Date: December 23, 2009 09:53PM

Thanks for prompt reply Rick.

Created other table (PUB_S_T) with
- Decimal(13,4)
- B_ID can not be NULL (thanks for the observation)

Tried the queries

WOW!!! What a time difference?
Why? Is it cached? How did you analyze this?


mysql> select max(query1.totalItems) from ( SELECT PUB_S_ID, count(T_ID) as totalItems from PUB_S_T group by PUB_S_ID) query1 ;
+------------------------+
| max(query1.totalItems) |
+------------------------+
| 32 |
+------------------------+
1 row in set (1 min 54.73 sec)

mysql> SELECT PUB_S_ID, count(*) as totalItems from PUB_S_T group by PUB_S_ID ORDER BY 2 DESC LIMIT 1 ;
+----------+------------+
| PUB_S_ID | totalItems |
+----------+------------+
| 9400997 | 32 |
+----------+------------+
1 row in set (3.82 sec)


But what I really need to speed up are the others. It's a matter of pride: Oracle Vs MySQL ;)
Thanks in advance
Gus

Options: ReplyQuote


Subject
Views
Written By
Posted
9542
December 15, 2009 04:53AM
3184
December 17, 2009 12:27AM
3059
December 23, 2009 04:34PM
2716
December 23, 2009 04:49PM
2615
December 23, 2009 06:07PM
3404
December 23, 2009 08:52PM
Re: 100% cpu usage on single cpu core
2479
December 23, 2009 09:53PM
2853
December 24, 2009 03:48PM


Sorry, you can't reply to this topic. It has been closed.

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.