On 07/28/2015 06:40 AM, David Belle wrote:
> I have a requirement for a project that I am working on and was
> hoping to gain some discussion on the idea of implementing an index
> type for lquery fields (see ltree’s
> http://www.postgresql.org/docs/9.4/static/ltree.html
> <http://www.postgresql.org/docs/9.4/static/ltree.html>)
>
> Currently ltree fields can have GIST/GIN indexes, but you cannot
> create a index for lquery or ltxtquery. In my scope, an index for
> lquery would be enough, although if it wasn’t too difficult it for to
> be expanded for ltxtquery fields, then this could also be
> implemented.
Hmm. My first thought is to extract labels from the query which are
required for any matches, and put those in the GIN index. When querying,
find all lqueries that have at least one label in common with the search
key.
- Heikki