Share

Netdisco

Tracker: Bugs

5 ineffective sql statements in db_clean - ID: 1739196
Last Update: Comment added ( fenner )

I had the problem that the nightly db cleanup took more than 4 hours after
upgrading from 0.94 to 0.96-cvs (~10 minutes before).

One part of the solution was a change of the sql statement in db_clean.
This saved ~1 hour of time. The main time was saved with an full vacuum of
the netdisco db. auto vacuum is enabled, and I've no idea why it was not
working effective. Maybe because I migrated the db dump from psql 7.4 to
8.1.

[...]
print " Deleting nodes that are actually device ports...\n";
# arcanez/IRC channel / RG
# DELETE FROM node WHERE mac IN (select mac from device_port union
select mac from device);
#my $num = sql_do(q/DELETE FROM node WHERE mac IN (select mac from
device_port)
# OR mac IN (select mac from device)/);
my $num = sql_do(q/DELETE FROM node WHERE mac IN (select mac from
device_port union select mac from device)/);
print " $num MAC entries deleted\n";

# arcanez/IRC
#$num = sql_do(q/DELETE FROM node_ip WHERE mac IN (select mac from
device_port)
# OR mac IN (select mac from device)/);
$num = sql_do(q/DELETE FROM node_ip WHERE mac IN (select mac from
device_port union select mac from device)/);
[...]


Ralf Gross ( ralfgross ) - 2007-06-18 16:20

5

Closed

Fixed

Nobody/Anonymous

Back-End

1.0

Public


Comment ( 1 )

Date: 2007-06-19 21:39
Sender: fennerProject Admin


Thanks for the reminder, I've committed this to CVS now.


Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2007-06-19 21:39 fenner
resolution_id None 2007-06-19 21:39 fenner
close_date - 2007-06-19 21:39 fenner