Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA51771; Wed, 21 Jul 1999 13:59:05 -0400 (EDT) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id NAA08306; Wed, 21 Jul 1999 13:57:35 -0400 (EDT) From: Bruce Momjian Message-Id: <199907211757.NAA08306@candle.pha.pa.us> Subject: Re: [GENERAL] Re: [SQL] bad select performance fixed by forbidding hash joins In-Reply-To: <2107.932577609@sss.pgh.pa.us> from Tom Lane at "Jul 21, 1999 01:20:09 pm" To: Tom Lane Date: Wed, 21 Jul 1999 13:57:35 -0400 (EDT) CC: George Young , pgsql-general@postgresql.org, pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL56 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > George Young writes: > > Yes! PGOPTIONS="-fh" made the query time go from 16 seconds to 2 seconds! > > Is this a safe thing to leave on permanently, or is there some way to set > > PGOPTIONS for just this query? > > I wouldn't recommend leaving it on as a long-term solution, because > you're hobbling the system for cases where hashjoin *is* the best > method. AFAIK there is not a SET VARIABLE method for enabling/disabling > plan types on-the-fly, though perhaps one should be added. Postgres does have options to prohibit certain join types, so you could try forcing a certain join type and see what happens. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026