A good mysql dlr table structure:

CREATE TABLE `dlr` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `smsc` varchar(20) NOT NULL,
  `ts` int(11) unsigned NOT NULL,
  `destination` varchar(20) NOT NULL,
  `source` varchar(20) NOT NULL,
  `service` varchar(20) NOT NULL,
  `url` varchar(200) NOT NULL,
  `mask` tinyint(2) NOT NULL,
  `status` enum('0') NOT NULL,
  `boxc` varchar(20) NOT NULL,
  `adddate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
*  KEY `smsc` (`smsc`,`ts`),*
 * KEY `dt` (`adddate`)*
) ENGINE=MyISAM


Note: periodically cleanup this table for *unfinished DLR's* with query like
below

*DELETE FROM dlr WHERE adddate <= DATE;

examples of DATE:
*

   1. *'2010-10-10 00:00:00'*
   2. *DATE_SUB(NOW(), INTERVAL 7 DAY) // keep last 7 days
   *





On Mon, Dec 20, 2010 at 10:54 PM, Alejandro Guerrieri <
[email protected]> wrote:

> Well, performance-wise is the fastest of all, since everything's performed
> in memory.
>
> However, there are drawbacks:
>
> - If Kannel crashes, your pending DLRs are gone.
> - If you don't clean it up from time to time and you have unfinished DLR's,
> it'll eventually eat up all your memory.
>
> Regards,
>
> Alex
>
>
> On Mon, Dec 20, 2010 at 7:45 PM, Oscar Cassetti <[email protected]
> > wrote:
>
>> Hello,
>>
>> I was wondering if the native dlr storage is good to be used in
>> production environment?
>> What about the performances ?
>>
>> Thank you,
>>
>> --
>> Oscar
>>
>>
>


-- 
Sincerely,

Sayed Hadi Rastgou Haghi

Reply via email to