Gin index on array of uuid

From: Enrique MailingLists <enrique(dot)mailing(dot)lists(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Gin index on array of uuid
Date: 2016-06-21 18:42:07
Message-ID: CADCw5QZctww5Q1MiTEx9OtOhT4g421Ftds=1MtTepqM2hLnrCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Currently creating an index on an array of UUID involves defining an
operator class. I was wondering if this would be a valid request to add as
part of the uuid-ossp extension? This seems like a reasonable operator to
support as a default for UUIDs. Any downsides to adding this as a default?

http://stackoverflow.com/questions/19959735/postgresql-gin-index-on-array-of-uuid

This is the definition from the stack overflow reference:

CREATE OPERATOR CLASS _uuid_ops DEFAULT
FOR TYPE _uuid USING gin AS
OPERATOR 1 &&(anyarray, anyarray),
OPERATOR 2 @>(anyarray, anyarray),
OPERATOR 3 <@(anyarray, anyarray),
OPERATOR 4 =(anyarray, anyarray),
FUNCTION 1 uuid_cmp(uuid, uuid),
FUNCTION 2 ginarrayextract(anyarray, internal, internal),
FUNCTION 3 ginqueryarrayextract(anyarray, internal, smallint,
internal, internal, internal, internal),
FUNCTION 4 ginarrayconsistent(internal, smallint, anyarray, integer,
internal, internal, internal, internal),
STORAGE uuid;

This would be helpful for people trying to use arrays of UUIDs in cloud
environments which limit root access.

Thank you,
Enrique

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2016-06-21 18:50:54 Re: Gin index on array of uuid
Previous Message José Luis Tallón 2016-06-21 17:58:02 Re: 10.0