Thread: Feature - Index support on an lquery field (from the ltree module)
Hi <div class=""><br class="" /></div><div class="">Forgive me if this is not the right place to discuss this. I am new tothe postgresql community.</div><div class=""><br class="" /></div><div class="">I have a requirement for a project thatI am working on and was hoping to gain some discussion on the idea of implementing an index type for lquery fields (seeltree’s <a class="" href="http://www.postgresql.org/docs/9.4/static/ltree.html">http://www.postgresql.org/docs/9.4/static/ltree.html</a>)</div><div class=""><brclass="" /></div><div class="">Currently ltree fields can have GIST/GIN indexes, but you cannot create a indexfor lquery or ltxtquery. In my scope, an index for lquery would be enough, although if it wasn’t too difficult it forto be expanded for ltxtquery fields, then this could also be implemented. </div><div class=""><br class="" /></div><divclass="">I have not contributed to postgres yet so I’m not really sure how to get started. </div><div class=""><brclass="" /></div><div class="">Thoughts?</div><div class=""><br class="" /></div><div class=""><br class="" /></div><divclass=""><br class="" /></div><div class=""><br class="" /></div><div class=""><br class="" /></div><div class=""><brclass="" /></div>
Re: Feature - Index support on an lquery field (from the ltree module)
From
Heikki Linnakangas
Date:
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