# sometimes very simple queries are extreemly slow

**URL:** <https://forums.percona.com/t/sometimes-very-simple-queries-are-extreemly-slow/199>\
**Category:** Other MySQL® Questions\
**Created:** [February 11, 2007, 8:11am UTC](https://forums.percona.com/t/sometimes-very-simple-queries-are-extreemly-slow/199 "2007-02-11T08:11:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergey\_shvets](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sergey\_shvets](https://forums.percona.com/u/sergey_shvets)\
**Post date:** [February 11, 2007, 8:11am UTC](https://forums.percona.com/t/sometimes-very-simple-queries-are-extreemly-slow/199/1 "2007-02-11T08:11:28Z")

</div>

Hello,

We are facing some strange problem here. Sometimes, mysql is performing a very simple queries.

A good example is e.g. (from slow query log)

# [User&#64;Host](mailto:User&#64;Host): user[user] @ [62.x.x.x]

# Query\_time: 14 Lock\_time: 0 Rows\_sent: 1 Rows\_examined: 0

SET timestamp=1171200111;  
select unix\_timestamp();

So it looks like all queries are collescted, like they are waiting for something, and then all of them are performed, the same moment.

All tables are MyISAM. When looking on those “hanging” processes with mysql processlist, their status is NULL.

Sometimes I could notice that with those NULL process one or two others are on status UPDATE or SENDING DATA status. Although tables involved in working queries are not the one related to NULL processes.(And even unix\_timestamp() is hanging).

What I also understood from mysql docs is that NULL status is not possible for any long period.

Please, any advice would be welcome, because I totally stuck overhere ☹

Problem is noticed on 5.0.18 and 5.0.27 both.

thanks,  
Sergey

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [February 11, 2007, 9:08am UTC](https://forums.percona.com/t/sometimes-very-simple-queries-are-extreemly-slow/199/2 "2007-02-11T09:08:04Z")

</div>

This is very strange.

Did you notice anything specific of system load when this happens and which OS version do you use ?

If you notice hanging of such simple query I’d connect to MySQL with GDB to trace where exactly it is waiting.

It could be some condition notification gets lost or something similar.

select unix\_timestamp() should not even lock any tables so it should be very low on mutexes.

---

<div class="post-metadata">

**Author:** ![sergey\_shvets](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@sergey\_shvets](https://forums.percona.com/u/sergey_shvets)\
**Post date:** [February 22, 2007, 9:39am UTC](https://forums.percona.com/t/sometimes-very-simple-queries-are-extreemly-slow/199/3 "2007-02-22T09:39:10Z")

</div>

Oke, issue came up to a bug in mysqld when setting a large query cache size (500MB in my case).

When cache is off it works fine.
