Storage compression with PostgreSQL


doing some test on Orthanc Win 18.12.0 with PostgreSQL 9.6 setting with StorageCompression = True

I cannot find any benefit ( for uncompressed 355 Mb Dicom images, the database is 565 Mb and the dumped

database file is 340 Mb). Is the Zlib compression not applied on the databases ?


Any help is appreciated …


Biotron spa con iOS

The option “StorageCompression” only affects the storage area (that contains the DICOM files), not the Orthanc database (that contains the index).

So I have to set Index in the database and storage in the file system to see the real compression of the images ?


Biotron spa

Sorry, I don’t understand your question.

If you want to know the disk space that is used by the Orthanc storage area, use the “/statistics” URI of the REST API. For instance:

$ curl http://localhost:8042/statistics
“CountInstances” : 92,
“CountPatients” : 2,
“CountSeries” : 4,
“CountStudies” : 2,
“TotalDiskSize” : “4051088”,
“TotalDiskSizeMB” : 3,
“TotalUncompressedSize” : “13830778”,
“TotalUncompressedSizeMB” : 13

=> This example indicates that the storage compression reduces the size of the storage area from 13MB to 3MB.

If you want to get the size of your PostgreSQL database, please read the PostgreSQL documentation:


Having set the StorageCompression=True, this is the statistic :

“CountInstances” : 16,
“CountPatients” : 1,
“CountSeries” : 16,
“CountStudies” : 1,
“TotalDiskSize” : “348330224”,
“TotalDiskSizeMB” : 332,
“TotalUncompressedSize” : “372848310”,
“TotalUncompressedSizeMB” : 355

The size is almost the same…
Where am I wrong ?


You are visibly storing DICOM images that are already compressed, e.g. using JPEG, JPEG-LS or JPEG2000. As a consequence, the “StorageCompression” cannot reduce the disk space further.

On raw, uncompressed DICOM images, the “StorageCompression” option typically leads to compression factor of 50%.