"(JobId, PathId, FilenameId)");
$bvfs->dbh_do("CREATE TABLE b2$$ AS (
-SELECT btemp.JobId, btemp.FileIndex, btemp.FilenameId, btemp.PathId $FileId
+SELECT btemp.JobId, btemp.FileIndex $FileId
FROM btemp, btemp2
WHERE btemp2.JobId = btemp.JobId
AND btemp2.PathId= btemp.PathId
return "b2$$";
}
+sub get_media_list_with_dir
+{
+ my ($table) = @_;
+ my $q="
+ SELECT DISTINCT VolumeName, Enabled, InChanger
+ FROM $table,
+ ( -- Get all media from this job
+ SELECT MIN(FirstIndex) AS FirstIndex, MAX(LastIndex) AS LastIndex,
+ VolumeName, Enabled, Inchanger
+ FROM JobMedia JOIN Media USING (MediaId)
+ WHERE JobId IN (SELECT DISTINCT JobId FROM $table)
+ GROUP BY VolumeName,Enabled,InChanger
+ ) AS allmedia
+ WHERE $table.FileIndex >= allmedia.FirstIndex
+ AND $table.FileIndex <= allmedia.LastIndex
+";
+ my $lst = $bvfs->dbh_selectall_arrayref($q);
+ return $lst;
+}
+
sub get_media_list
{
my ($jobid, $fileid) = @_;
# the media list that will be needed for restore
} elsif ($action eq 'get_media') {
my ($jobid, $fileid, $table);
+ my $lst;
# in this mode, we compute the result to get all needed media
if (CGI::param('force')) {
exit 1;
}
# mysql is very slow without this index...
- if ($bvfs->dbh_is_mysql()) {
- $bvfs->dbh_do("CREATE INDEX idx_$table ON $table (FileId)");
- }
- $jobid = "SELECT DISTINCT JobId FROM $table";
- $fileid = "SELECT FileId FROM $table";
-
+# if ($bvfs->dbh_is_mysql()) {
+# $bvfs->dbh_do("CREATE INDEX idx_$table ON $table (FileId)");
+# }
+ $lst = get_media_list_with_dir($table);
} else {
$jobid = join(',', @jobid);
$fileid = join(',', grep { /^\d+(,\d+)*$/ } CGI::param('fileid'));
+ $lst = get_media_list($jobid, $fileid);
}
- if ($jobid and $fileid) {
- my $lst = get_media_list($jobid, $fileid);
+ if ($lst) {
print "[";
print join(',', map { "['$_->[0]',$_->[1],$_->[2]]" } @$lst);
print "]\n";
-15Apr09
+19May09
+ebl Speed up media list generation when using
+ "compute with directories" option
+15May09
ebl speed up mysql to compute restore table
ebl speed up mysql when computing media list
ebl fix media list display
ebl fix bresto problem with drag&drop
-05Apr09
+05May09
ebl Make working the "compute with directories" option
-04Apr09
+04May09
ebl Add View copies option to bresto
ebl Tweak command output to add hide/display button
29Mar09