--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/6a133a51-64f9-428f-b1e1-0f2e5de6490a%40googlegroups.com.
Hi,
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/38bbb5c9-f910-43e6-a439-d3a164df9661%40googlegroups.com.
-- merge Filename in File tableINSERT INTO TmpMergeFilenameIntoFileTable (FileId, FileIndex, JobId, PathId, Name, DeltaSeq, MarkId, LStat, Md5) SELECT File.FileId, File.FileIndex, File.JobId, File. PathId, Filename.Name, File.DeltaSeq, File.MarkId, File.LStat, File.Md5 FROM File, Filename WHERE File.FilenameId = Filename.FilenameId;Hi,
set enable_hashjoin to 'off';set enable_mergejoin to 'off';-- update db schema from 2004 to 2171
-- table UnsavedFiles is not used, therefore dropped.DROP TABLE IF EXISTS UnsavedFiles;
---- merge Filenames (from Filename.Name) info File table--
-- To use lesser disk space,-- drops indices, that needs to regenerated anyway.DROP INDEX IF EXISTS file_jobid_idx;DROP INDEX IF EXISTS file_jpfid_idx;
-- this temporary table, used for the migration, should not exist, but drop it just in case.DROP TABLE IF EXISTS TmpMergeFilenameIntoFileTable;
-- start transactionBEGIN;
-- create temporary table to be used as File table laterCREATE TABLE TmpMergeFilenameIntoFileTable ( FileId BIGSERIAL NOT NULL, FileIndex INTEGER NOT NULL DEFAULT 0, JobId INTEGER NOT NULL, PathId INTEGER NOT NULL, DeltaSeq SMALLINT NOT NULL DEFAULT 0, MarkId INTEGER NOT NULL DEFAULT 0, Fhinfo NUMERIC(20) NOT NULL DEFAULT 0, Fhnode NUMERIC(20) NOT NULL DEFAULT 0, LStat TEXT NOT NULL, Md5 TEXT NOT NULL, Name TEXT NOT NULL, PRIMARY KEY (FileId));
set enable_hashjoin to 'off';set enable_mergejoin to 'off';
-- merge Filename in File tableINSERT INTO TmpMergeFilenameIntoFileTable (FileId, FileIndex, JobId, PathId, Name, DeltaSeq, MarkId, LStat, Md5) SELECT File.FileId, File.FileIndex, File.JobId, File. PathId, Filename.Name, File.DeltaSeq, File.MarkId, File.LStat, File.Md5 FROM File, Filename WHERE File.FilenameId = Filename.FilenameId;
DROP TABLE Filename;DROP TABLE File;ALTER TABLE TmpMergeFilenameIntoFileTable RENAME TO File;ALTER INDEX TmpMergeFilenameIntoFileTable_pkey RENAME TO file_pkey;
-- adapt indexCREATE INDEX file_jobid_idx ON File (JobId);ALTER SEQUENCE TmpMergeFilenameIntoFileTable_fileid_seq RENAME TO file_fileid_seq;SELECT setval('file_fileid_seq', (SELECT max(fileid) from file));CREATE INDEX file_jpfid_idx ON File (JobId, PathId, Name);CREATE INDEX file_pjidpart_idx ON File(PathId,JobId) WHERE FileIndex = 0 AND Name = '';
-- Add JobMedia JobBytes info, also used by NDMP DARALTER TABLE JobMedia ADD COLUMN JobBytes NUMERIC(20) DEFAULT 0;
UPDATE Version SET VersionId = 2171;
COMMIT;
set client_min_messages = fatal;
ANALYSE;