OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: slow query log

From: Ananda Kumar (anandklgmail.com)
Date: Thu Jan 01 2009 - 23:14:05 CST


mysql> explain SELECT SUM(COUNTER_VALUE) FROM STO_LIS sl,
    -> SCAT_LIS sfl WHERE sl.STO_LIS_ID =
    -> sfl.LIS_ID AND sfl.CAT_ID = '-1';

+----+-------------+-------+------+-----------------------+-------------------+---------+---------------------+------+-------------+
| id | select_type | table | type | possible_keys |
key | key_len | ref | rows | Extra |
+----+-------------+-------+------+-----------------------+-------------------+---------+---------------------+------+-------------+
| 1 | SIMPLE | sfl | ref | PRIMARY,sfcatlist_lst |
PRIMARY | 4 | const | 23 | Using index |
| 1 | SIMPLE | sl | ref | STO_LIST_UK | STO_LIS_UK | 4 |
sm15.sfl.lis_id | 1 | Using where |
+----+-------------+-------+------+-----------------------+-------------------+---------+---------------------+------+-------------+
2 rows in set (0.31 sec)

mysql> SELECT SUM(COUNTER_VALUE) FROM STORES_LISTING sl,
SFCATEGORY_LISTING sfl WHERE sl.STORES_LISTING_ID = sfl.LISTING_ID AND
sfl.CATEGORY_ID = '-1';
+--------------------+
| SUM(COUNTER_VALUE) |
+--------------------+
| NULL |
+--------------------+
1 row in set (0.00 sec)

On 12/31/08, Baron Schwartz <baronxaprb.com> wrote:
>
> Hi,
>
> On Wed, Dec 31, 2008 at 8:44 AM, Ananda Kumar <anandklgmail.com> wrote:
> > Hi All,
> > I have enabled slow query log.
> > Generally this file will have sql's which take more than long-query time
> to
> > execute and also sql's not using indexes.
> > But i see sql's which does not come under the above condition.
> > I have set the long-query time to 1 Sec .
> >
> > The query takes less than 1 sec to execute and also uses indexes, but
> still
> > its recored in slow query log.
>
> What is the execution time shown in the slow query log?
>
> What is the query?
>
> If you can paste the whole log entry here, that would be good.
>
>
> --
> Baron Schwartz, Director of Consulting, Percona Inc.
> Our Blog: http://www.mysqlperformanceblog.com/
> Our Services: http://www.percona.com/services.html
>