Data Types

PG-Strom support the following data types for use on GPU device.

Built-in numeric types

SQL data types Internal format Length Memo
smallint cl_short 2 bytes
integer cl_int 4 bytes
bigint cl_long 8 bytes
real cl_float 4 bytes
float cl_double 8 bytes
numeric cl_ulong variable length mapped to 64bit internal format

Note

When GPU processes values in numeric data type, it is converted to an internal 64bit format because of implementation reason. It is transparently converted to/from the internal format, on the other hands, PG-Strom cannot convert numaric datum with large number of digits, so tries to fallback operations by CPU. Therefore, it may lead slowdown if numeric data with large number of digits are supplied to GPU device. To avoid the problem, turn off the GUC option pg_strom.enable_numeric_type not to run operational expression including numeric data types on GPU devices.

Built-in date and time types

SQL data types Internal format Length Memo
date DateADT 4 bytes
time TimeADT 8 bytes
timetz TimeTzADT 12 bytes
timestamp Timestamp 8 bytes
timestamptz TimestampTz 8 bytes
interval Interval 16 bytes

Built-in variable length types

SQL data types Internal format Length Memo
bpchar varlena * variable length
varchar varlena * variable length
bytea varlena * variable length
text varlena * variable length

Built-in miscellaneous types

SQL data types Internal format Length Memo
boolean cl_bool 1 byte
money cl_long 8 bytes
uuid pg_uuid 16 bytes
macaddr macaddr 6 bytes
inet inet_struct 7 bytes or 19 bytes
cidr inet_struct 7 bytes or 19 bytes

Built-in range data types

SQL data types Internal format Length Memo
int4range __int4range 14 bytes
int8range __int8range 22 bytes
tsrange __tsrange 22 bytes
tstzrange __tstzrange 22 bytes
daterange __daterange 14 bytes

Extra Types

SQL data types Internal format Length Memo
float2 half_t 2 bytes Half precision data type
reggstore cl_uint 4 bytes Specific version of regclass for gstore_fdw. Special handling at PL/CUDA function invocation.