efficient device delete which does not walk nodes

This commit is contained in:
Oliver Gorwits
2013-09-02 21:27:22 +01:00
parent 5807fd0323
commit be806d5ab1
16 changed files with 193 additions and 32 deletions

View File

@@ -130,7 +130,15 @@ sub _set_canonical_ip {
my $gone = $device->device_ips->delete;
debug sprintf ' [%s] device - removed %s aliases',
$oldip, $gone;
$device->delete;
# our special delete which is more efficient
schema('netdisco')->resultset('Device')
->search({ ip => $device->ip })->delete;
# a new row object from the old one
$device = schema('netdisco')->resultset('Device')
->new({ $device->get_columns });
debug sprintf ' [%s] device - deleted self', $oldip;
});