Re: Bool btree_gin index not chosen on equality contraint, but on greater/lower?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bool btree_gin index not chosen on equality contraint, but on greater/lower?
Date: 2016-02-14 16:51:14
Message-ID: 19580.1455468674@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com> writes:
> I tried to add bool support to the btree_gin contrib module, and as far as I can tell, it seems to
> work (wasn't that complicated, actually).
> But now I'm stuck, as PostgreSQL doesn't seem to like to use my new index, if I use equality or
> unequality, just with greater and lower than.

I think your problem is that the planner won't apply
match_boolean_index_clause() or expand_boolean_index_clause(),
because it has a hard-wired idea of which index opclasses could
possibly benefit from that, cf IsBooleanOpfamily().

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2016-02-14 17:24:39 Re: proposal: enhancing slow query log, and autoexplain log about waiting on lock before query exec time
Previous Message Tom Lane 2016-02-14 16:46:47 Re: proposal: enhancing slow query log, and autoexplain log about waiting on lock before query exec time