Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 836EB476558 for ; Wed, 27 Nov 2002 11:31:52 -0500 (EST) Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by postgresql.org (Postfix) with ESMTP id C2F4647612C for ; Wed, 27 Nov 2002 11:29:57 -0500 (EST) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.9.3/8.9.3) with ESMTP id TAA11522; Wed, 27 Nov 2002 19:29:44 +0300 (MSK) Date: Wed, 27 Nov 2002 19:29:43 +0300 (MSK) From: Oleg Bartunov X-X-Sender: megera@ra.sai.msu.su To: Tom Lane Cc: Achilleus Mantzios , Pgsql Hackers Subject: Re: [GENERAL] FreeBSD, Linux: select, select count(*) performance In-Reply-To: <17919.1038413758@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/1034 X-Sequence-Number: 32250 On Wed, 27 Nov 2002, Tom Lane wrote: > Achilleus Mantzios writes: > > Linux q1 > > ======== > > dynacom=# EXPLAIN ANALYZE SELECT count(*) from noon; > > NOTICE: QUERY PLAN: > > > Aggregate (cost=20508.19..20508.19 rows=1 width=0) (actual > > time=338.17..338.17 > > rows=1 loops=1) > > -> Seq Scan on noon (cost=0.00..20237.95 rows=108095 width=0) (actual > > time=0.01..225.73 rows=108095 loops=1) > > Total runtime: 338.25 msec > > > Linux q2 > > ======== > > dynacom=# EXPLAIN ANALYZE SELECT * from noon; > > NOTICE: QUERY PLAN: > > > Seq Scan on noon (cost=0.00..20237.95 rows=108095 width=1960) (actual > > time=1.22..67909.31 rows=108095 loops=1) > > Total runtime: 68005.96 msec > > You didn't say what was *in* the table, exactly ... but I'm betting > there are a lot of toasted columns, and that the extra runtime > represents the time to fetch (and perhaps decompress) the TOAST entries. Are there any reason to "fetch (and perhaps decompress) the TOAST entries" just to count(*) without any WHERE clause ? > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83