bareos: master 015652a7

Author Committer Branch Timestamp Parent
bruno-at-bareos bruno-at-bareos master 2023-06-21 15:55 master 6c6568cd Pending
Changeset cats: add sql lstat_decode function, version 2230

- introduce a new sql function decode_lstat to help querying lstat field
  of file table with PostgreSQL language and tool.
  By default the function will return all available fields in lstat
  you can restrict the desired field(s) by passing those in the param
  text array.
- improvements made to the original function:
  + Moving to parallel safe gain 1 sec
    Time: 33375.061 ms (00:33.375) - Original query
    Time: 32689.084 ms (00:32.689) - Adding Parallel safe
  + Replace regexp_split_to_array by faster string_to_array (Arogge)
    Time: 23095.753 ms (00:23.096) - 10 seconds gain
  + Replace length() for each loop with a variable; another 1s win
  + Reimplement FromBase64() function to handle bigint, skip negative
  + LinkFi need a review compared to C code (here bigint)
  + Modify lstat_decode() to return a table without the need to create
    an empty table make the use easier
  + Future investigation get_bit,get_byte function may offer
    further gain speed in bareos_frombase64()
- add a query for bconsole 22 list top XX biggest files for a jobid
- remove sql instruction from update script
- ddl scripts: unset PAGER before psql call
- move basefiles_baseid_seq alter to sql script
- add decode lstat function to update script
- as rhel7 use PostgreSQL < 10 function attribue parallel safe is
  applied with an alter instruction only if pg > 10
  use pg_temp.exec function so no drop is needed
- cats: update database version to 2230
- add database version pattern to cats.h

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
mod - core/src/cats/cats.h Diff File
mod - core/src/cats/ddl/creates/postgresql.sql Diff File
add - core/src/cats/ddl/updates/postgresql.2210_2230.sql Diff File
mod - core/src/cats/ddl/versions.map.in Diff File
mod - core/src/cats/make_bareos_tables.in Diff File
mod - core/src/cats/update_bareos_tables.in Diff File
mod - core/src/dird/query.sql Diff File