From: Matthias <nitrogenycs@gmail.com>
To: depesz@depesz.com, "Jeff Janes" <jeff.janes@gmail.com>
Cc: Robert Sosinski <rsosinski@ticketevolution.com>
Cc: pgsql-general@postgresql.org, pgsql-performance@postgresql.org, "Spike Grobstein" <spike@ticketevolution.com>
Subject: Re: [GENERAL] Inaccurate Explain Cost
Date: Thu, 27 Sep 2012 12:48:24 +0200
Message-ID: <op.wlaiyyw50uf2nk@nitrogenycs3> (raw)
In-Reply-To: <CAMkU=1zcVExmcWPka2GHzaYe1kOcBX0pHzcV+hSfgFtHEk7fFQ@mail.gmail.com>
References: <ED7ED14D0D304B2FB38B191F3C160A22@ticketevolution.com>
<20120926202140.GB10681@depesz.com>
<CAMkU=1zcVExmcWPka2GHzaYe1kOcBX0pHzcV+hSfgFtHEk7fFQ@mail.gmail.com>
Am 27.09.2012, 02:04 Uhr, schrieb Jeff Janes <jeff.janes@gmail.com>:
> On Wed, Sep 26, 2012 at 1:21 PM, hubert depesz lubaczewski
> <depesz@depesz.com> wrote:
>> On Wed, Sep 26, 2012 at 02:38:09PM -0400, Robert Sosinski wrote:
>>> The first query shows a cost of 190,169.55 and runs in 199,806.951 ms.
>>> When I disable nested loop, I get a cost of 2,535,992.34 which runs in
>>> only 133,447.790 ms. We have run queries on our database with a cost
>>> of 200K cost before and they ran less then a few seconds, which makes
>>> me wonder if the first query plan is inaccurate. The other issue is
>>> understanding why a query plan with a much higher cost is taking less
>>> time to run.
>>
>> Are you under impression that cost should be somehow related to actual
>> time?
>
> I am certainly under that impression. If the estimated cost has
> nothing to do with run time, then what is it that the cost-based
> optimizer is trying to optimize?
See http://www.postgresql.org/docs/9.2/static/runtime-config-query.html
section "18.7.2. Planner Cost Constants".
-Matthias
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: nitrogenycs@gmail.com, jeff.janes@gmail.com, rsosinski@ticketevolution.com, spike@ticketevolution.com
Subject: Re: [GENERAL] Inaccurate Explain Cost
In-Reply-To: <op.wlaiyyw50uf2nk@nitrogenycs3>
* 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