Skip site navigation (1) Skip section navigation (2)

Re: EXPLAIN ANALYZE on 8.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Evgeny Gridasov <eugrid(at)fpm(dot)kubsu(dot)ru>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: EXPLAIN ANALYZE on 8.2
Date: 2006-12-14 16:41:15
Message-ID: 21516.1166114475@sss.pgh.pa.us (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-hackerspgsql-performance
Evgeny Gridasov <eugrid(at)fpm(dot)kubsu(dot)ru> writes:
> This is a Linux Debian 3.1 ontop of 2x XEON 3.4 Ghz.
> PostgreSQL is 8.2 checked out from CVS REL8_2_STABLE yesterday.
> I'm running the same Postgres on another machine,
> with Debian Etch and have the same results.

Hmph.  With 8.2 on Fedora 5 on a 2.8Ghz dual Xeon, I get this:


regression=# create table foo as select x from generate_series(1,2500000) x;
SELECT
regression=# vacuum foo;
VACUUM
regression=# checkpoint;
CHECKPOINT
regression=# \timing
Timing is on.
regression=# select count(*) from foo;
  count
---------
 2500000
(1 row)

Time: 666.639 ms
regression=# select count(*) from foo;
  count
---------
 2500000
(1 row)

Time: 609.514 ms
regression=# explain analyze select count(*) from foo;
                                                     QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=44764.00..44764.01 rows=1 width=0) (actual time=1344.812..1344.813 rows=1 loops=1)
   ->  Seq Scan on foo  (cost=0.00..38514.00 rows=2500000 width=0) (actual time=0.031..748.571 rows=2500000 loops=1)
 Total runtime: 1344.891 ms
(3 rows)

Time: 1345.755 ms
regression=# explain analyze select count(*) from foo;
                                                     QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=44764.00..44764.01 rows=1 width=0) (actual time=1324.846..1324.847 rows=1 loops=1)
   ->  Seq Scan on foo  (cost=0.00..38514.00 rows=2500000 width=0) (actual time=0.046..748.582 rows=2500000 loops=1)
 Total runtime: 1324.902 ms
(3 rows)

Time: 1325.591 ms
regression=#

which works out to about 0.14 microsec per gettimeofday call, on a
machine that ought to be slower than yours.  So I think you've got
either a crummy motherboard, or a kernel that doesn't know the best
way to read the clock on that hardware.  There is some discussion
of this in the archives (probably in pgsql-hackers); look back around
May or so when we were unsuccessfully trying to hack EXPLAIN to use
fewer gettimeofday calls.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2006-12-14 16:50:26
Subject: Re: Slow update with simple query
Previous:From: Mark LewisDate: 2006-12-14 16:34:55
Subject: Re: Slow update with simple query

pgsql-hackers by date

Next:From: Dave PageDate: 2006-12-14 16:49:22
Subject: Re: libpq.a in a universal binary
Previous:From: Evgeny GridasovDate: 2006-12-14 16:29:20
Subject: Re: EXPLAIN ANALYZE on 8.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group