From: Craig A. James <cjames@modgraph-usa.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Simple join optimized badly?
Date: Sun, 08 Oct 2006 19:42:44 -0700
Message-ID: <4529B724.9070904@modgraph-usa.com> (raw)
In-Reply-To: <200610090212.k992CCP10515@momjian.us>
References: <200610090212.k992CCP10515@momjian.us>
Bruce Momjian wrote:
> I can do 100! on my computer, but can't do it in my head.
A poor example. 100! is a simple repetative calculation, something computers are very good at. Optimizing an SQL query is very difficult, and a completely different class of problem.
The fact is the PG team has done a remarkable job with the optimizer so far. I'm usually very happy with its plans. But humans still beat computers at many tasks, and there are unquestionably areas where the PG optimizer is not yet fully developed.
When the optimizer reaches its limits, and you have to get your web site running, a HINT can be invaluable.
I said something in a previous version of this topic, which I'll repeat here. The PG documentation for HINTs should be FILLED with STRONG ADMONITIONS to post the problematic queries here before resorting to hints.
There will always be fools who abuse hints. Too bad for them, but don't make the rest of us suffer for their folly.
Craig
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: cjames@modgraph-usa.com, bruce@momjian.us
Subject: Re: Simple join optimized badly?
In-Reply-To: <4529B724.9070904@modgraph-usa.com>
* 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