bitnine-oss / agensgraph

AgensGraph, a transactional graph database based on PostgreSQL
http://www.agensgraph.org
Other
1.34k stars 149 forks source link

fix: Make `=` operator with vertices work for hash join #469

Closed protodef closed 5 years ago

protodef commented 5 years ago

This change adds the following entries to the catalog to make vertex hashable.

Run the following SQL statements as a superuser to update the existing catalog.

CREATE FUNCTION pg_catalog.vertex_hash(pg_catalog.vertex)
  RETURNS pg_catalog.int4
  LANGUAGE internal
  IMMUTABLE
  STRICT
  PARALLEL SAFE
  AS 'vertex_hash';

CREATE OPERATOR FAMILY pg_catalog.vertex_ops USING hash;

CREATE OPERATOR CLASS pg_catalog.vertex_ops
  DEFAULT FOR TYPE pg_catalog.vertex
  USING hash
  AS
    OPERATOR 1 pg_catalog.=,
    FUNCTION 1 pg_catalog.vertex_hash(pg_catalog.vertex);