[sr-dev] db version of nat pinger

Klaus Darilion klaus.mailinglists at pernau.at
Mon Sep 17 12:00:37 CEST 2012



On 17.09.2012 11:48, Juha Heinanen wrote:
> Klaus Darilion writes:
>
>> I wonder why "expires" is checked at all? Expired contacts will be
>> deleted automatically so the chance to ping expired contacts should be
>> very small.
>
> klaus,
>
> i wondered the same.  it would not really hurt much if a small number of
> expired contacts are binged for vain.
>
> otherwise regarding the query, these two conditions
>
> cflags & 0 = 0 and id % 20 = 0

I guess the first '0' is the nat_flag?

> are very inefficient, because an operation is applied to a field before
> comparison.  if nat flag would always be the largest flag, comparison
> could go like this:
>
> cflags >= "value of last flag"

Not sure if an index would be much faster here. Also the cflags & 0 = 0 
should be rather fast.

regards
Klaus



More information about the sr-dev mailing list