Re: calculating time

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: "pg-general (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: calculating time
Date: 2003-04-16 12:26:27
Message-ID: 20030416122627.GC1917@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 16, 2003 at 08:19:28AM -0400, Johnson, Shaunn wrote:

> Nested Loop (cost=0.00..5662254656.82 rows=138 width=199)
>
> The cost is supposed to be the amount of time it may take to
> do a query, right? So what, exactly, is this? 500 hours?
> minutes? CPU time?

It's an arbitrary unit that can't be reliably converted into some
real-world time. You can try using EXPLAIN ANALYZE, which will execute
the query and give you timed costs. With that data you can also
probably check that the estimates given by the planner are within some
reasonable range.

One thing I've wondered is if one can trust the "conversion" to keep
roughly the same from one query to another, i.e. if I determine the
constants to convert estimates to execution time, can I use that in the
future? (same machine, same shared buffers settings, etc)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"XML!" Exclaimed C++. "What are you doing here? You're not a programming
language."
"Tell that to the people who use me," said XML.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2003-04-16 13:46:36 Re: [GENERAL] Problem about pgsql's column alias
Previous Message ow 2003-04-16 12:20:17 Re: Are we losing momentum?