$filesInBackup->{$path_key}->{'size'}
));
+ # daylight saving time change offset for 1h
+ my $dst_offset = 60 * 60;
+
+ my $key_dst1 = join(" ", (
+ $shareID,
+ $dir,
+ $path_key,
+ $filesInBackup->{$path_key}->{'mtime'} - $dst_offset,
+ $filesInBackup->{$path_key}->{'size'}
+ ));
+
+ my $key_dst2 = join(" ", (
+ $shareID,
+ $dir,
+ $path_key,
+ $filesInBackup->{$path_key}->{'mtime'} + $dst_offset,
+ $filesInBackup->{$path_key}->{'size'}
+ ));
+
my $found;
- if (! defined($beenThere->{$key}) && ! ($found = found_in_db($key, @data)) ) {
+ if (
+ ! defined($beenThere->{$key}) &&
+ ! defined($beenThere->{$key_dst1}) &&
+ ! defined($beenThere->{$key_dst2}) &&
+ ! ($found = found_in_db($key, @data))
+ ) {
print STDERR "# key: $key [", $beenThere->{$key},"]" if ($debug >= 2);
if ($filesInBackup->{$path_key}->{'type'} == BPC_FTYPE_DIR) {
--- /dev/null
+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;
+
+delete from backups where date > abstime('2005-10-24')::int;
+vacuum analyze backups;
+
+create index dst_i1 on dst_files(shareid) ;
+create index dst_i2 on dst_files(num) ;
+vacuum analyze dst_files ;
+create index dst_i3 on files(backupnum) ;
+vacuum analyze files ;
+
+select id into dst_files_ids from files inner join dst_files on dst_files.shareid = files.shareid and dst_files.num = files.backupnum ;
+create unique index dst_i4 on dst_files_ids(id) ;
+vacuum analyze dst_files_ids ;
+
+delete from files where id in (select id from dst_files_ids) ;
+
+vacuum full analyze verbose files ;
+
+drop table dst_files_ids ;
+drop table dst_files ;
+
+drop index dst_i3 ;