/[BackupPC]/trunk/sql/zz_dst_files_fix.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/sql/zz_dst_files_fix.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 249 - (hide annotations)
Fri Dec 9 16:27:49 2005 UTC (18 years, 5 months ago) by dpavlin
File size: 1030 byte(s)
small fixes

1 dpavlin 249 drop index dst_i1 ;
2     drop index dst_i2 ;
3     drop index dst_i3 ;
4     drop table dst_files_ids ;
5     drop table dst_files ;
6    
7    
8 dpavlin 240 select hostid,shareid,num,abstime(date),size,inc_size into dst_files from backups where date > abstime('2005-10-24')::int order by abstime,hostid,num;
9    
10 dpavlin 249 delete from archive_backup where backup_id in (select id from backups where date > abstime('2005-10-24')::int) ;
11 dpavlin 240 delete from backups where date > abstime('2005-10-24')::int;
12     vacuum analyze backups;
13    
14     create index dst_i1 on dst_files(shareid) ;
15     create index dst_i2 on dst_files(num) ;
16     vacuum analyze dst_files ;
17     create index dst_i3 on files(backupnum) ;
18     vacuum analyze files ;
19    
20     select id into dst_files_ids from files inner join dst_files on dst_files.shareid = files.shareid and dst_files.num = files.backupnum ;
21     create unique index dst_i4 on dst_files_ids(id) ;
22     vacuum analyze dst_files_ids ;
23    
24     delete from files where id in (select id from dst_files_ids) ;
25    
26     vacuum full analyze verbose files ;
27    
28     drop table dst_files_ids ;
29     drop table dst_files ;
30    
31     drop index dst_i3 ;

  ViewVC Help
Powered by ViewVC 1.1.26