Re: Join Filter vs. Index Cond (performance regression 9.1->9.2+/HEAD)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Join Filter vs. Index Cond (performance regression 9.1->9.2+/HEAD)
Date: 2015-05-31 11:58:29
Message-ID: CA+TgmoYdxN7iHAi2XX+Xfvem6q0rbXe91WBPt_5jkr-Vx6T-bA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 29, 2015 at 6:45 PM, Andrew Gierth
<andrew(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
> Obviously it makes little sense to use an (a,b,c) index to look up just
> (a,b) and then filter on c; the question is, what is the planner doing
> that leads it to get this so wrong? Finding a workaround for it was not
> easy, either - the only thing that I found that worked was replacing the
> t1 join with a lateral join with an OFFSET 0 clause to nobble the
> planner entirely.

I agree. That looks like a bug.

The fact that it chooses index-only scans is also a little strange,
considering that they seem to be entirely ineffective. The tables
have never been vacuumed, so presumably, the all-visible bits are all
0, and the planner knows it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-05-31 12:00:44 Re: problems on Solaris
Previous Message Robert Haas 2015-05-31 11:55:12 Re: session_replication_role origin vs local