int2vector and btree indexes - Mailing list pgsql-hackers

From Amit Langote
Subject int2vector and btree indexes
Date
Msg-id d9bb74f8-b194-7307-9ebd-90645d377e45@lab.ntt.co.jp
Whole thread Raw
Responses Re: int2vector and btree indexes  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
If I create btree index on a int2vector column, it does not get used for
queries because the query search always fails to match the index operator
(family).

During index creation, GetDefaultOpClass() returns array_ops for a
int2vector index column, because type int2vector is binary-coercible with
anyarray (which is array_ops's input type).  Whereas queries involving
int2vector columns would use a int2vector_ops operator.

I wonder if the index creation command should rather fail because an index
thus created will never get used?  Or is_indexable_operator() should
somehow consider the fact that such indexes could in fact exist?

I might be missing something though.

Thanks,
Amit





pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Forbid use of LF and CR characters in database and role names
Next
From: Masahiko Sawada
Date:
Subject: Re: Quorum commit for multiple synchronous replication.