From:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To:
Robert Haas <robertmhaas(at)gmail(dot)com>
Cc:
Mark Mielke <mark(at)mark(dot)mielke(dot)cc>, Jeroen Vermeulen <jtv(at)xs4all(dot)nl>,
Alex Hunsaker <badalex(at)gmail(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>,
Bart Samwel <bart(at)samwel(dot)tk>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>,
pgsql-hackers(at)postgresql(dot)org
Subject:
Re: Avoiding bad prepared-statement plans.
Date:
2010-02-26 17:01:59
Message-ID:
29600.1267203719@sss.pgh.pa.us (view raw or flat )
Thread:
2010-02-09 12:08:54 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-09 12:59:15 from Yeb Havinga <yebhavinga(at)gmail(dot)com>
2010-02-09 13:46:55 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-09 14:53:17 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-10 00:47:18 from Kris Jurka <books(at)ejurka(dot)com>
2010-02-11 03:12:41 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-11 04:07:57 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-09 22:21:43 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-02-09 13:50:32 from Richard Huxton <dev(at)archonet(dot)com>
2010-02-09 14:25:19 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-09 14:45:57 from Richard Huxton <dev(at)archonet(dot)com>
2010-02-09 14:10:22 from Andres Freund <andres(at)anarazel(dot)de>
2010-02-09 14:28:01 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-09 16:43:52 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-09 16:59:41 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-11 03:15:01 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-11 06:26:15 from Дмитрий Фефелов <fozzy(at)ac-sw(dot)com>
2010-02-11 12:09:33 from Bart Samwel <bart(at)samwel(dot)tk>
2010-02-11 12:25:28 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-02-11 12:39:49 from Bart Samwel <bart(at)samwel(dot)tk>
2010-02-11 12:41:12 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-11 12:48:14 from Bart Samwel <bart(at)samwel(dot)tk>
2010-02-11 13:04:46 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-11 16:17:40 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-11 16:39:11 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-02-15 19:11:34 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-15 20:03:21 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-15 20:05:29 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-16 14:28:57 from Greg Stark <gsstark(at)mit(dot)edu>
2010-02-16 14:31:44 from Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
2010-02-16 20:17:32 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-17 03:12:50 from Greg Stark <gsstark(at)mit(dot)edu>
2010-02-15 19:51:26 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-16 14:22:00 from Greg Stark <gsstark(at)mit(dot)edu>
2010-02-17 22:52:14 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-21 12:37:50 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-26 02:48:05 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-26 03:19:21 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-26 03:40:35 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 04:01:14 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-26 04:25:46 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-28 14:12:32 from Greg Stark <gsstark(at)mit(dot)edu>
2010-02-26 04:28:14 from Alex Hunsaker <badalex(at)gmail(dot)com>
2010-02-26 04:46:20 from Alex Hunsaker <badalex(at)gmail(dot)com>
2010-02-26 05:11:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 06:29:41 from Alex Hunsaker <badalex(at)gmail(dot)com>
2010-02-26 15:07:00 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 15:27:30 from Alex Hunsaker <badalex(at)gmail(dot)com>
2010-02-26 16:51:53 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-26 18:11:44 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 16:50:37 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-26 20:02:40 from Alex Hunsaker <badalex(at)gmail(dot)com>
2010-02-26 08:13:31 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-26 10:20:17 from Jeroen Vermeulen <jtv(at)xs4all(dot)nl>
2010-02-26 14:49:35 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-26 16:27:11 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 16:54:10 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-26 17:01:59 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 20:11:16 from Yeb Havinga <yebhavinga(at)gmail(dot)com>
2010-02-26 20:29:11 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-26 20:46:27 from Yeb Havinga <yebhavinga(at)gmail(dot)com>
2010-02-26 22:40:06 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-27 00:03:06 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-27 00:50:11 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-28 01:01:43 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-28 04:22:00 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-03-01 02:47:38 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-26 18:53:38 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-26 18:59:22 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 19:22:37 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-26 19:57:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 20:26:05 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-02-26 20:47:55 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2010-02-26 19:23:22 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-03-01 11:18:01 from Yeb Havinga <yebhavinga(at)gmail(dot)com>
2010-02-28 04:20:38 from Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
2010-02-28 07:52:55 from Mark Mielke <mark(at)mark(dot)mielke(dot)cc>
2010-03-01 02:51:14 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-03-02 23:54:28 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-03-03 05:13:46 from Robert Haas <robertmhaas(at)gmail(dot)com>
2010-02-28 08:18:26 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-03-02 23:53:56 from Bruce Momjian <bruce(at)momjian(dot)us>
2010-02-18 14:58:25 from "Pierre C" <lists(at)peufeu(dot)com>
2010-02-18 15:09:42 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-02-18 16:47:01 from "Pierre C" <lists(at)peufeu(dot)com>
2010-02-18 16:54:31 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-02-18 20:19:21 from "Pierre C" <lists(at)peufeu(dot)com>
2010-02-19 02:31:05 from David Christensen <david(at)endpoint(dot)com>
2010-02-19 13:57:51 from Kenneth Marshall <ktm(at)rice(dot)edu>
2010-02-19 17:56:12 from Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
2010-02-11 13:41:02 from Yeb Havinga <yebhavinga(at)gmail(dot)com>
Lists:
pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Feb 26, 2010 at 11:27 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Also, I think there is a lot of confusion here over two different
>> issues: generic plan versus parameter-specific plan, and bad planner
>> estimates leading to a wrong plan choice. While the latter is certainly
>> an issue sometimes, there is no reason to believe that it affects
>> prepared statements worse than non-prepared ones. So I think that
>> designing a fix for prepared statements on the assumption that you can't
>> trust the planner's estimates is solving the wrong problem.
> The two issues seem intimately connected to me. Of course, estimates
> can be inaccurate for many reasons, but ONE of those reasons is that
> the planner is optimizing for an unknown parameter value which has
> very different distribution from the actually supplied value.
Right, but if the parameter is unknown then its distribution is also
unknown. In any case that's just nitpicking, because the solution is
to create a custom plan for the specific value supplied. Or are you
suggesting that we should create a way for users to say "here is the
expected distribution of this parameter", and then try to fold that into
the planner estimates? I think the uptake on that would be about nil;
not to mention that it fails to fix several of the most pressing
problems, such as LIKE indexing and partition selection, where all the
distribution information in the world doesn't help. You need the exact
value.
regards, tom lane
In response to
Responses
pgsql-hackers by date
Next :From: Bruce MomjianDate: 2010-02-26 17:09:23
Subject : Re: ecpg tests broken by pgindent run
Previous :From : Bruce MomjianDate : 2010-02-26 16:58:25
Subject : Re: ecpg tests broken by pgindent run