Re: query not using index
Posted by: gigi kent
Date: November 03, 2013 12:43PM

Here they are:

| geotable | CREATE TABLE `geotable` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `accuracy` smallint(6) NOT NULL DEFAULT '0',
  `activity` tinyint(4) NOT NULL DEFAULT '0',
  `lat` double(9,8) NOT NULL,
  `lon` double(9,8) NOT NULL,
  `language` char(2) NOT NULL DEFAULT 'en',
  `sex` char(1) NOT NULL DEFAULT 'm',
  `locality` varchar(128) NOT NULL DEFAULT 'undisclosed',
  `country` char(4) NOT NULL DEFAULT '',
  `province` varchar(32) NOT NULL DEFAULT '',
  `city` varchar(32) NOT NULL DEFAULT '',
  `text` varchar(32) DEFAULT 'some nickname',
  `status` varchar(64) DEFAULT 'ask me',
  `time` bigint(13) NOT NULL,
  UNIQUE KEY `uk_uid` (`uid`),
  KEY `lat_lon_time` (`lat`,`lon`,`time`),
  KEY `ctry_time` (`country`,`time`),
  KEY `time_lang` (`time`,`language`),
  KEY `time_sex` (`time`,`sex`),
  CONSTRAINT `geotable_constr_1` FOREIGN KEY (`uid`) REFERENCES `userstable` (`uid`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=700555 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC |

| userstable | CREATE TABLE `userstable` (
  `uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` varchar(2049) NOT NULL,
  `sha1_user_id` char(40) CHARACTER SET ascii NOT NULL,
  `user_pw` varchar(255) DEFAULT NULL,
  `acc_create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_logout` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `online_status` tinyint(4) DEFAULT '0',
  `failed_logins` int(11) DEFAULT '0',
  `account_status` tinyint(4) DEFAULT '1',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `sha1_user_id` (`sha1_user_id`),
  KEY `user_pw` (`user_pw`),
  KEY `user_id` (`user_id`(255)),
  KEY `last_login` (`last_login`),
  KEY `last_logout` (`last_logout`)
) ENGINE=InnoDB AUTO_INCREMENT=700562 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC |

| userstable    | InnoDB |      10 | Compact    |  501374 |            130 |    65634304 |               0 |    121487360 | 240123904 |         700562 | 2013-07-05 13:04:10 | NULL                | NULL       | utf8_general_ci   |     NULL | row_format=DYNAMIC |         |


| geotable | InnoDB |      10 | Compact    |  199917 |            102 |    20496384 |               0 |     38273024 | 240123904 |         700555 | 2013-10-24 06:45:56 | NULL                | NULL       | utf8_general_ci   |     NULL | row_format=DYNAMIC

Thanks for the link, it has been checked already :)
For now, I'll stick to just making these indexes work.

Options: ReplyQuote


Subject
Written By
Posted
October 31, 2013 07:40AM
November 02, 2013 02:58PM
Re: query not using index
November 03, 2013 12:43PM
November 04, 2013 05:39AM
November 05, 2013 09:53PM
November 08, 2013 09:42AM
November 09, 2013 03:42PM
November 12, 2013 09:54PM
November 13, 2013 06:31PM
November 13, 2013 08:56PM
November 18, 2013 12:20AM


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.