wasted_file Table

This table stores the paths to the current wasted files in the environment, as well as properties of the files such as last modification or file size.

wasted_file

wasted_file table

Column Name

Type

Nullable

Primary

Description

path

text

false

false

The path of the file

file_size_kb

bigint

false

false

The size of the file

modification_time

timestamp with time zone

false

false

Last time the file was modified

storage_oid

bigint

false

false

The oid of the storage which contains the file

storage_name

text

false

false

Name of the storage (denormalized for reporting)

Sample Use Cases

Get information about storage files for a data store:

The query returns the storage name, the file path, the site of the file and the last modified time for each file of a data store. The query accepts the $storage_oid as a parameter.

SELECT storage_name as "Datastore",
       path as "File Path",
       file_size_kb as "File Size",
       modification_time as "Last Modified Time"
  FROM wasted_file
 WHERE file_size_kb >= 0
   AND ARRAY[storage_oid]::text[] && Array['$storage_oid']::text[]
 ORDER BY 3 DESC