From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Fuhr <mike@fuhr.org>
Cc: Jean-Pierre Pelletier <pelletier_32@sympatico.ca>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org, John Arbash Meinel <john@arbash-meinel.com>
Subject: Re: Queries 15 times slower on 8.1 beta 2 than on 8.0
Date: Thu, 22 Sep 2005 19:50:02 -0400
Message-ID: <18133.1127433002@sss.pgh.pa.us> (raw)
In-Reply-To: <20050922231746.GA25296@winnie.fuhr.org>
References: <BAYC1-PASMTP01EE67AD3A0034394D85D895970@CEZ.ICE>
<433326A6.8010708@arbash-meinel.com>
<BAYC1-PASMTP0276B50280C40ABC9BBCB495970@CEZ.ICE>
<200509221519.05555.josh@agliodbs.com>
<20050922225432.GA25103@winnie.fuhr.org>
<021501c5bfca$6fe82130$6501a8c0@JP>
<20050922231746.GA25296@winnie.fuhr.org>
Michael Fuhr <mike@fuhr.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
inline patch 1: src/backend/optimizer/path/indxpath.c (+1/-3 lines) download inline-1.patch*** 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, mike@fuhr.org, pelletier_32@sympatico.ca, josh@agliodbs.com, john@arbash-meinel.com
Subject: Re: Queries 15 times slower on 8.1 beta 2 than on 8.0
In-Reply-To: <18133.1127433002@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox