Re: Queries 15 times slower on 8.1 beta 2 than on 8.0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Jean-Pierre Pelletier <pelletier_32(at)sympatico(dot)ca>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-performance(at)postgresql(dot)org, John Arbash Meinel <john(at)arbash-meinel(dot)com>
Subject: Re: Queries 15 times slower on 8.1 beta 2 than on 8.0
Date: 2005-09-22 23:50:02
Message-ID: 18133.1127433002@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> Tom Lane says he's found the problem; I expect he'll be committing
> a fix shortly.

The attached patch allows it to generate the expected plan, at least
in the test case I tried.

regards, tom lane

*** src/backend/optimizer/path/indxpath.c.orig Sun Aug 28 18:47:20 2005
--- src/backend/optimizer/path/indxpath.c Thu Sep 22 19:17:41 2005
***************
*** 955,969 ****
/*
* Examine each joinclause in the joininfo list to see if it matches any
* key of any index. If so, add the clause's other rels to the result.
- * (Note: we consider only actual participants, not extraneous rels
- * possibly mentioned in required_relids.)
*/
foreach(l, rel->joininfo)
{
RestrictInfo *joininfo = (RestrictInfo *) lfirst(l);
Relids other_rels;

! other_rels = bms_difference(joininfo->clause_relids, rel->relids);
if (matches_any_index(joininfo, rel, other_rels))
outer_relids = bms_join(outer_relids, other_rels);
else
--- 955,967 ----
/*
* Examine each joinclause in the joininfo list to see if it matches any
* key of any index. If so, add the clause's other rels to the result.
*/
foreach(l, rel->joininfo)
{
RestrictInfo *joininfo = (RestrictInfo *) lfirst(l);
Relids other_rels;

! other_rels = bms_difference(joininfo->required_relids, rel->relids);
if (matches_any_index(joininfo, rel, other_rels))
outer_relids = bms_join(outer_relids, other_rels);
else

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Anu Kucharlapati 2005-09-23 00:21:33 FW: Deadlock Issue with PostgreSQL
Previous Message Josh Berkus 2005-09-22 23:35:06 Re: Queries 15 times slower on 8.1 beta 2 than on 8.0