Questions tagged «composite-index»

9
什么时候应该使用复合索引?
什么时候应该在数据库中使用复合索引? 使用复合索引对性能有何影响? 为什么要使用复合索引? 例如,我有一张homes桌子: CREATE TABLE IF NOT EXISTS `homes` ( `home_id` int(10) unsigned NOT NULL auto_increment, `sqft` smallint(5) unsigned NOT NULL, `year_built` smallint(5) unsigned NOT NULL, `geolat` decimal(10,6) default NULL, `geolng` decimal(10,6) default NULL, PRIMARY KEY (`home_id`), KEY `geolat` (`geolat`), KEY `geolng` (`geolng`), ) ENGINE=InnoDB ; 对geolat和都使用复合索引对我来说是否有意义geolng: 我取代: KEY …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.