Oleg (obartunov) wrote,
Oleg
obartunov

Bloom index for bigint

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;
Tags: bloom, pg, pgen
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 1 comment