bareos: bareos-17.2 f4929da7

Author Committer Branch Timestamp Parent
stephand joergs bareos-17.2 2017-09-20 02:03 bareos-17.2 654b5759 Pending
Changeset Fix .bvfs_lsdirs: Empty result for root node, performance enhanced

The underlying SQL query returned an empty result set for the root node,
when using .bvfs_lsdirs with the empty path argument, eg.
.bvfs_lsdirs jobid=23,45,48 path=
The SQL query was changed to fix this. It also performs better,
especially on MySQL/MariaDB, where it requires the following index:
CREATE INDEX PathId_JobId_FileIndex ON File (PathId, JobId, FileIndex);

The changed query also performs better on PostgreSQL. The following
partial index should be used on PostgreSQL:
CREATE INDEX file_jidpart_idx ON File(JobId) WHERE FileIndex = 0 AND Name = '';

For new installations these indexes will be created automatically, also
when upgrading from 16.x using the update_bareos_tables script.
mod - src/cats/ddl/creates/mysql.sql Diff File
mod - src/cats/ddl/updates/mysql.2004_2170.sql Diff File
mod - src/cats/dml/0064_bvfs_lsdirs_7 Diff File
mod - src/cats/mysql_queries.inc Diff File
mod - src/cats/postgresql_queries.inc Diff File
mod - src/cats/sqlite_queries.inc Diff File