On Wed, Apr 16, 2003 at 08:26:27 -0400,
Alvaro Herrera <alvherre@dcc.uchile.cl> wrote:
> 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.
But I wouldn't try it with the sample query since that won't finish in
a reasonable amount of time.
Just to get a rough idea of the scale factor, on my machine the estimated
cost is close to the execution time in milliseconds.