By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,847 Members | 2,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,847 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.