MySQL Forums
Forum List  »  General

Re: Query optimization question
Posted by: Nino Skilj
Date: March 02, 2009 01:41PM

Here's the hourstable:
CREATE TABLE `hourstable` (
  `HTID` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `UserID` int(11) unsigned NOT NULL DEFAULT '0',
  `WorkDate` date NOT NULL DEFAULT '0000-00-00',
  `Hours` decimal(6,2) unsigned DEFAULT NULL,
  `Description` text,
  `LogDate` datetime DEFAULT NULL,
  `SumPaid` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `Approved` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `PaidDate` datetime DEFAULT NULL,
  `In` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Out` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TimezoneID` tinyint(3) unsigned DEFAULT '31',
  `LastChangeDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `InIPAddress` varchar(15) NOT NULL DEFAULT '',
  `OutIPAddress` varchar(15) NOT NULL DEFAULT '',
  `TimeClass` tinyint(3) unsigned NOT NULL DEFAULT '1',
  `Type` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `Note` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`RecordID`),
  KEY `ix_totalsum` (`UserID`,`SumPaid`),
  KEY `ix_accrualsum` (`TimeClass`,`Approved`),
  KEY `ix_userid` (`UserID`)
) ENGINE=ndbcluster DEFAULT CHARSET=utf8
[\code]

Here's the show status:
+---------+------------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------+
| Name    | Engine     | Version | Row_format | Rows    | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation       | Checksum | Create_options | Comment |
+---------+------------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------+
| hourstable | ndbcluster |      10 | Dynamic    | 1444701 |            112 |   254771200 |               0 |            0 |         0 |        1510021 | NULL        | NULL        | NULL       | utf8_general_ci |     NULL |                |         | 
+---------+------------+---------+------------+---------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------+

[\code]

Let me know if that helps... Not sure how it can though. The explain says it's only looking through 10 rows and then just 1... That (to me) seems like it should be an automatic result. Am I missing something?

Nino

Options: ReplyQuote


Subject
Written By
Posted
February 27, 2009 04:34PM
February 28, 2009 06:36AM
February 28, 2009 04:03PM
Re: Query optimization question
March 02, 2009 01:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.