summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Multi/Maintenance.pm12
-rw-r--r--util/dump.sql25
-rw-r--r--util/updates/update_2.8.sql4
3 files changed, 6 insertions, 35 deletions
diff --git a/lib/Multi/Maintenance.pm b/lib/Multi/Maintenance.pm
index 0bd5eb91..4f816e56 100644
--- a/lib/Multi/Maintenance.pm
+++ b/lib/Multi/Maintenance.pm
@@ -18,12 +18,12 @@ sub spawn {
$p => [qw|
_start shutdown set_daily daily set_monthly monthly log_stats
vncache tagcache vnpopularity cleangraphs
- usercache statscache revcache logrotate
+ usercache statscache logrotate
|],
],
heap => {
daily => [qw|vncache tagcache vnpopularity cleangraphs|],
- monthly => [qw|usercache statscache revcache logrotate|],
+ monthly => [qw|usercache statscache logrotate|],
@_,
},
);
@@ -173,14 +173,6 @@ sub statscache {
}
-sub revcache {
- # This -really- shouldn't be necessary...
- # Currently takes about 25 seconds to complete
- $_[KERNEL]->post(pg => do => q|SELECT update_rev('vn', ''), update_rev('releases', ''), update_rev('producers', '')|,
- undef, 'log_stats', 'revcache');
-}
-
-
sub logrotate {
my $dir = sprintf '%s/old', $VNDB::M{log_dir};
mkdir $dir if !-d $dir;
diff --git a/util/dump.sql b/util/dump.sql
index 9f8710f8..0fdf5696 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -420,31 +420,6 @@ ALTER TABLE wlists ADD FOREIGN KEY (vid) REFERENCES vn
-------------------------
--- update_rev(table, ids) - updates the rev column in the changes table
-CREATE FUNCTION update_rev(tbl text, ids text) RETURNS void AS $$
-DECLARE
- r RECORD;
- r2 RECORD;
- i integer;
- t text;
- e text;
-BEGIN
- SELECT INTO t SUBSTRING(tbl, 1, 1);
- e := '';
- IF ids <> '' THEN
- e := ' WHERE id IN('||ids||')';
- END IF;
- FOR r IN EXECUTE 'SELECT id FROM '||tbl||e LOOP
- i := 1;
- FOR r2 IN EXECUTE 'SELECT id FROM '||tbl||'_rev WHERE '||t||'id = '||r.id||' ORDER BY id ASC' LOOP
- UPDATE changes SET rev = i WHERE id = r2.id;
- i := i+1;
- END LOOP;
- END LOOP;
-END;
-$$ LANGUAGE plpgsql;
-
-
-- update_vncache(id) - updates the c_* columns in the vn table
CREATE FUNCTION update_vncache(id integer) RETURNS void AS $$
DECLARE
diff --git a/util/updates/update_2.8.sql b/util/updates/update_2.8.sql
index 3c1d7398..d8373210 100644
--- a/util/updates/update_2.8.sql
+++ b/util/updates/update_2.8.sql
@@ -207,3 +207,7 @@ END;
$$ LANGUAGE plpgsql;
SELECT tag_vn_calc();
+
+-- remove update_rev()
+DROP FUNCTION update_rev(text, text);
+