Re: calculating time - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: calculating time
Date
Msg-id 20030416122627.GC1917@dcc.uchile.cl
Whole thread Raw
In response to calculating time  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
Responses Re: calculating time  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: calculating time  (Bruno Wolff III <bruno@wolff.to>)
List 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.


pgsql-general by date:

Previous
From: "Johnson, Shaunn"
Date:
Subject: calculating time
Next
From: Network Administrator
Date:
Subject: Re: OT: mail server blocked