<div>hi<br>Is anyone have a success story of optimizing ippool sql table to make it work faster?<br>The default scheme is very slow, and then you have about 25000 subscribers it's not work.<br><br>I trying to add indexes to this table. It make fast selects, but slow updates.<br>
<br>[code]<br>CREATE TABLE `radippool` (<br>  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,<br>  `pool_name` varchar(30) NOT NULL,<br>  `framedipaddress` varchar(15) NOT NULL DEFAULT '',<br>  `nasipaddress` varchar(15) NOT NULL DEFAULT '',<br>
  `calledstationid` varchar(30) NOT NULL,<br>  `callingstationid` varchar(30) NOT NULL,<br>  `expiry_time` datetime DEFAULT NULL,<br>  `username` varchar(64) NOT NULL DEFAULT '',<br>  `pool_key` varchar(30) NOT NULL,<br>
  PRIMARY KEY (`id`),<br>  KEY `allocate-find` (`pool_name`,`expiry_time`,`callingstationid`)<br>) ENGINE=MyISAM AUTO_INCREMENT=34817 DEFAULT CHARSET=utf8<br>[/code]</div><div><br></div><div>Next I tried to make table from the begin. Here it is<br>
<br>[code]<br>CREATE TABLE `radippool_new` (<br>  `id` int(4) unsigned NOT NULL AUTO_INCREMENT,<br>  `pool_name` tinyint(1) unsigned NOT NULL,<br>  `framedipaddress` int(4) unsigned NOT NULL,<br>  `nasipaddress` int(4) unsigned DEFAULT NULL,<br>
  `calledstationid` bigint(8) unsigned NOT NULL,<br>  `callingstationid` bigint(8) unsigned NOT NULL,<br>  `expiry_time` timestamp NULL DEFAULT NULL,<br>  `username` varchar(64) NOT NULL,<br>  `pool_key` int(5) unsigned NOT NULL DEFAULT '0',<br>
  PRIMARY KEY (`id`),<br>  KEY `allocate-find` (`pool_name`,`expiry_time`,`callingstationid`) USING BTREE<br>) ENGINE=InnoDB AUTO_INCREMENT=34817 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='Ip pool for customers'</div>
<div><br></div><div>CREATE TABLE `radippool_names` (<br>  `id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT,<br>  `pool_name` varchar(64) NOT NULL,<br>  PRIMARY KEY (`id`)<br>) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8<br>
[/code]</div><div><br></div><div>It's working two time faster, than default with updates queries. But two time slower with selects queries.<br><br>Maybe some one have a good modification of ippool table or another changes of default scheme, and could share it?</div>
<div><br clear="all"></div><div><i>Regards,</i>
</div><div>Alexander</div>