Bloom index for bigint

Oct 02, 2018 16:14

Bloom index by default works for int4 and text, but other types with hash function and equality operator could be supported. Just use opclass interface, for example, for type bigint

CREATE OPERATOR CLASS bigint_ops
DEFAULT FOR TYPE bigint USING bloom AS
OPERATOR 1 =(bigint, bigint),
FU>CTION 1 hashint8(bigint);

Now, you can build bloom index for bigint data type.

PS.
Data types, which could be supported by bloom index.

SELECT oc.opcintype::regtype, p.amproc FROM pg_opclass oc
JOIN pg_amproc p ON p.amprocfamily = oc.opcfamily
WHERE oc.opcmethod = 405 AND oc.opcdefault AND p.amprocnum = 1
AND p.amproclefttype = oc.opcintype AND p.amprocrighttype = oc.opcintype;

pg, pgen, bloom

Previous post Next post
Up