ALTER TABLE path ALTER COLUMN path SET STATISTICS 1000;
CREATE UNIQUE INDEX path_name_idx on path (path);
--- In File table
--- FileIndex can be 0 for FT_DELETED files
--- FileNameId can link to Filename.Name='' for directories
CREATE TABLE file
(
fileid bigserial not null,
primary key (fileid)
);
-CREATE INDEX file_jobid_idx on file (jobid);
-CREATE INDEX file_fp_idx on file (filenameid, pathid);
+CREATE INDEX file_jpfid_idx on file (jobid, pathid, filenameid);
+
+-- If you are running PostgreSQL >= 8.2, you can remove this index
+-- the database engine is able to use the composite index
+-- and it increase performances during insertion
+CREATE INDEX file_jobid_idx on file(jobid);
--
-- Add this if you have a good number of job
--
-- CREATE INDEX file_pathid_idx on file(pathid);
-- CREATE INDEX file_filenameid_idx on file(filenameid);
--- CREATE INDEX file_jpfid_idx on file (jobid, pathid, filenameid);
CREATE TABLE job
(
General:
+22Sep09
+ebl Remove the file_fp_idx index for Postgresql (FilenameId, PathId) on
+ File table.
+ It is useless for common usage, and causes performance issues.
+ This index fragments over the time and the update cost grows
+ very quickly. (This index is not present on Mysql schema)
17Sep09
kes Fix seg fault in ignoredir code
15Sep09