Mailing List
Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
ODBC - ODBC with the MySQL Connector/ODBC driver
Perl - Perl support for MySQL with DBI and DBD::mysql
MySQL++ - Programming with the C++ API to MySQL
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
MySQL takes 8Sek, MySQLcc takes 0.1Sek to run the same query. WHY???

MySQL takes 8Sek, MySQLcc takes 0.1Sek to run the same query. WHY???

2004-03-13       - By Fredrik Högberg

 Back
Hi!
I 'm trying to run the following query.

"(SELECT
Priority, OnDateExt, OnTime, OnMilli, OffDateExt, OffTime, Name, Native_SumDesc, Comment
FROM history.alarm_summary
WHERE OnDateExt > DATE_SUB(CURDATE(), INTERVAL 14 DAY) )
UNION
(SELECT
Priority, OnDateExt, OnTime, OnMilli, OffDateExt, OffTime, Name, Native_SumDesc, Comment
FROM history.event_summary
WHERE OnDateExt > DATE_SUB(CURDATE(), INTERVAL 14 DAY) )

ORDER BY 2 DESC, 3 DESC, 4 DESC
LIMIT 0,38 "


The alarm_summary and event_summary contains about 150k records and OnDateExt, OnTime, OnMilli is indexed.

The fun part is that this this query takes about 8-10 sek to complete with excel(import external data), the mysql client (command prompt) and a using odbc mfc classes but with MySQLcc it takes only 0.1sek to run???
I 've tried to change the query so there 's no possibility that MySQLcc has cached something but cannot make mysqlcc run the query under 0.2 sek.

Can anybody have any clue on why this is happening.

This is a quite serious issue because if the query takes 8sek i have to seriously rethink things to make it run faster because the mysql server is running at high cpu usage during the query and i have other tasks at that computer that also needs a little cpu time. Perhaps move the last 14 days of data into a separate table instead of running the query in the large table but how can the mysqlcc be that fast???, it has to be an illusion but i cant figure out why i 'm seeing it.

Any thoughts

Cheers
Fredrik H?gberg