Search Postgresql Archives

Re: How long will the query take

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bill Moran <wmoran@xxxxxxxxxxxxxxxxx> wrote:

> > No, not really. But you can (and should) run EXPLAIN <your query> to
> > obtain the execution plan for that query, und you can show us this plan
> > (and the table-definition for all included tables). Maybe someone is able
> > to tell you what you can do to speed up your query.
> 
> To piggyback on this ... EXPLAIN _is_ the way to know how long your
> query will take, but keep in mind it's only an _estimate_.
> 
> Given that, in my experience EXPLAIN is pretty accurate 90% of the
> time, as long as you analyze frequently enough.

As far as i know, EXPLAIN _can't_ say how long a query will take, it
returns only a COST, not a TIME.

Or can you tell me how long this query will be take?

test=# explain select * from foo;
                      QUERY PLAN
-------------------------------------------------------
 Seq Scan on foo  (cost=0.00..34.00 rows=2400 width=4)
(1 Zeile)


Okay, it's a really little table and a really simple plan ... but
imagine, i have a table with 100 millions rows and a) a slow disk and b)
a fast SSD.

You can't say how long the query will runs, even an estimate, okay?


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux