• Tom Lane's avatar
    Remove unnecessary int2vector-specific hash function and equality operator. · 5c80642a
    Tom Lane authored
    These functions were originally added in commit d8cedf67 to support
    use of int2vector columns as catcache lookup keys.  However, there are
    no catcaches that use such columns.  (Indeed I now think it must always
    have been dead code: a catcache with such a key column would need an
    underlying unique index on the column, but we've never had an int2vector
    btree opclass.)
    
    Getting rid of the int2vector-specific operator and function does not
    lose any functionality, because operations on int2vectors will now fall
    back to the generic anyarray support.  This avoids a wart that a btree
    index on an int2vector column (made using anyarray_ops) would fail to
    match equality searches, because int2vectoreq wasn't a member of the
    opclass.  We don't really care much about that, since int2vector is not
    meant as a type for users to use, but it's silly to have extra code and
    less functionality.
    
    If we ever do want a catcache to be indexed by an int2vector column,
    we'd need to put back full btree and hash opclasses for int2vector,
    comparable to the support for oidvector.  (The anyarray code can't be
    used at such a low level, because it needs to do catcache lookups.)
    But we'll deal with that if/when the need arises.
    
    Also worth noting is that removal of the hash int2vector_ops opclass will
    break any user-created hash indexes on int2vector columns.  While hash
    anyarray_ops would serve the same purpose, it would probably not compute
    the same hash values and thus wouldn't be on-disk-compatible.  Given that
    int2vector isn't a user-facing type and we're planning other incompatible
    changes in hash indexes for v10 anyway, this doesn't seem like something
    to worry about, but it's probably worth mentioning here.
    
    Amit Langote
    
    Discussion: <d9bb74f8-b194-7307-9ebd-90645d377e45@lab.ntt.co.jp>
    5c80642a
catcache.c 50.1 KB