From: | mlw <markw(at)mohawksoft(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Andrew Sullivan <andrew(at)libertyrms(dot)info>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Index Scans become Seq Scans after VACUUM ANALYSE |
Date: | 2002-04-18 11:52:35 |
Message-ID: | 3CBEB383.2C012FF9@mohawksoft.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> By and large this argument reminds me of the "compiler versus hand-
> programmed assembler" argument. Which was pretty much a dead issue
> when I was an undergrad, more years ago than I care to admit in a
> public forum. Yes, a competent programmer who's willing to work
> hard can out-code a compiler over small stretches of code. But no
> one tries to write large systems in assembler anymore. Hand-tuned
> SQL is up against that same John-Henry-vs-the-steam-hammer logic.
> Maybe the current PG optimizer isn't quite in the steam hammer
> league yet, but it will get there someday. I'm more interested
> in revving up the optimizer than in betting on John Henry.
I am not suggesting that anyone is going to write each and every query with
hints, but a few select queries, yes, people will want to hand tune them.
You are right no one uses assembler to create big systems, but big systems
often have spot optimizations in assembler. Even PostgreSQL has assembler in
it.
No generic solution can be perfect for every specific application. There will
always be times when hand tuning a query will produce better results, and
sometimes that will make the difference between using PostgreSQL or use
something else.
For the two years I have been subscribed to this list, this is a fairly
constant problem, and the answer is always the same, in effect, "we're working
on it." If PostgreSQL had the ability to accept hints, one could say, "We are
always working to improve it, but in your case you may want to give the
optimizer a hint as to what you expect it to do."
It may not be the "best" solution in your mind, but speaking as a long time
user of PostgreSQL, it would be a huge help to me, and I'm sure I am not alone.
From | Date | Subject | |
---|---|---|---|
Next Message | Justin Clift | 2002-04-18 12:03:28 | Re: new food for the contrib/ directory |
Previous Message | Jakub Ouhrabka | 2002-04-18 11:34:46 | another optimizer question |