468,553 Members | 1,314 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,553 developers. It's quick & easy.

Some slow-query-log entries don't make sense

Hi All,

I'm trying to use the slow-query-log (with
--log-queries-not-using-indexes enabled) to determine if any queries
need optimization, and have a few questions about some entries I'm
seeing.

First question: given a table defined as:

CREATE TABLE `oa_location` (
`rowid` int(11) NOT NULL auto_increment,
`pLocation` varchar(7) NOT NULL default '',
`cLocation` varchar(7) NOT NULL default '',
[...]
PRIMARY KEY (`rowid`),
KEY `oaloc001` (`pLocation`),
KEY `oaloc002` (`cLocation`),
KEY `oaloc003` (`locType`)
) ENGINE=MyISAM AUTO_INCREMENT=448 DEFAULT CHARSET=latin1

Why would this query appear in the slow-query-log:

# Query_time: 0 Lock_time: 0 Rows_sent: 6 Rows_examined: 6
select pLocation from oa_location order by pLocation;

This query apparently took no time, and it used an indexed field.

Second question: given a table defined as:

CREATE TABLE `oa_paycode` (
`payCode` smallint(4) unsigned zerofill NOT NULL default '0000',
`shortDesc` varchar(9) default NULL,
`longDesc` varchar(30) default NULL,
`visible` enum('Y','N') default 'Y',
PRIMARY KEY (`payCode`),
UNIQUE KEY `paycd001` (`payCode`),
KEY `paycd002` (`visible`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

why would this query show up in the slow-query-log:
# Query_time: 0 Lock_time: 0 Rows_sent: 177 Rows_examined: 177
select * from oa_paycode;

Again, the query apparently took no time, and it presumably didn't need
an index (or used the primary key) since all records were requested.

Any explanations or advice would be greatly appreciated.

-Dave H.

Oct 11 '06 #1
0 2469

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by John Bailo | last post: by
50 posts views Thread by diffuser78 | last post: by
3 posts views Thread by michael | last post: by
1 post views Thread by pkochanek | last post: by
3 posts views Thread by UJ | last post: by
10 posts views Thread by penworthamnaynesh | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.