All Products
Search
Document Center

ApsaraDB RDS:ST_MD5Sum

Last Updated:Mar 28, 2026

Returns the MD5 hash string of a raster object.

Syntax

text ST_MD5Sum(raster raster_obj)

Parameters

ParameterDescription
raster_objThe raster object to query.

Description

ST_MD5Sum looks up the MD5 hash string in the raster object's metadata. If no MD5 hash string is found in the metadata, the function returns NULL for data-internal raster objects. For raster objects stored in Alibaba Cloud Object Storage Service (OSS), the function calculates the MD5 hash string from the OSS path.

To pre-compute the MD5 hash string at storage time and cache it in the metadata, configure the following GUC parameters:

ParameterTypeDescriptionValid valuesDefault
ganos.raster.calculate_md5booleanSpecifies whether to calculate and save the MD5 hash string to metadata when the raster object is stored.true | falsefalse
ganos.raster.md5sum_chunk_sizeintegerThe chunk size, in MB, for each read operation when calculating the MD5 hash string.1–25610

Example configuration:

SET ganos.raster.calculate_md5 = true;
SET ganos.raster.md5sum_chunk_size = 20;

Examples

Query the MD5 hash string of a raster object:

SELECT ST_MD5Sum(rast)
FROM raster_table
WHERE id = 1;

Result:

              st_md5sum
-----------------------------------
 21f41fd983d3139c75b04bff2b7bf5c9