From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-sql@hub.org
Subject: Re: [SQL] SQL query _slow_
Date: Mon, 22 Feb 1999 10:42:59 -0500
Message-ID: <8710.919698179@sss.pgh.pa.us> (raw)
In-Reply-To: <199902220400.XAA82447@hub.org>
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Gregg Berkholtz <gregg@gbcomputers.com> writes:
>> Would indexes help at all? <-- If so, what should I index to get the best
>> speed?
> Not sure. If EXPLAIN is slow showing results, it is just the optimizer.
Assuming Bruce has correctly diagnosed the problem (I think he has),
adding indexes would make things *worse* in 6.4.*, because it'd increase
the number of cases the optimizer has to consider.
Bruce fixed several bugs in the optimizer that were causing it to
consider far more combinations than it should in queries that join a
lot of tables. So your query should work OK in 6.5, and at that point
you should try adding indexes to improve the speed of the actual query
(as opposed to the planning stage).
As a stopgap measure while you're using 6.4.*, try setting the GEQO
threshold to less than 7 tables.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgsql-sql@hub.org
Subject: Re: [SQL] SQL query _slow_
In-Reply-To: <8710.919698179@sss.pgh.pa.us>
References: <199902220400.XAA82447@hub.org> <8710.919698179@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