On Sun, Apr 6, 2008 at 9:32 AM, kokoska rokoska <<a href="mailto:kokoska.rokoska@post.cz" target="_blank">kokoska.rokoska@post.cz</a>> wrote:<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Am I missing something, or should I create indexes by myself? If yes, on<br>
what columns?</blockquote></div></blockquote><div><br>that really all depends on what sort of queries you'll be running ... here is a sample schema i use at one place<br><br>CREATE TABLE `cdr` (<br> `accountcode` varchar(20) NOT NULL default '',<br>
`caller_id_number` varchar(80) NOT NULL default '',<br> `destination_number` varchar(80) NOT NULL default '',<br> `context` varchar(80) NOT NULL default '',<br> `caller_id` varchar(80) NOT NULL default '',<br>
`channel_name` varchar(80) NOT NULL default '',<br> `bridge_channel` varchar(80) NOT NULL default '',<br> `last_app` varchar(80) NOT NULL default '',<br> `last_arg` varchar(80) NOT NULL default '',<br>
`start_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',<br> `answer_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',<br> `end_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',<br>
`duration` int(11) NOT NULL default '0',<br> `billsec` int(11) NOT NULL default '0',<br> `hangup_cause` varchar(45) NOT NULL default '',<br> `amaflags` varchar(45) NOT NULL default '',<br>
`uuid` varchar(36) NOT NULL default '',<br> `userfield` varchar(20) NOT NULL default '',<br> `cost` varchar(20) default NULL,<br> KEY `userfield` (`userfield`),<br> KEY `accountcode` (`accountcode`),<br>
KEY `hangup_cause` (`hangup_cause`),<br> KEY `context` (`context`),<br> KEY `destination_number` (`destination_number`),<br> KEY `end_timestamp` (`end_timestamp`)<br>) ENGINE=MyISAM DEFAULT CHARSET=utf8;<br></div></div>
<br>-- <br>wasim h. baig | principal consultant | convergence pk | +92 300 8508070