Re: [GENERAL] FreeBSD, Linux: select, select count(*) performance

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] FreeBSD, Linux: select, select count(*) performance
Date: 2002-11-27 16:29:43
Message-ID: Pine.GSO.4.44.0211271928320.11279-100000@ra.sai.msu.su
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

On Wed, 27 Nov 2002, Tom Lane wrote:

> Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> 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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2002-11-27 16:30:33 Re: Server v7.3RC2 Dies
Previous Message Tom Lane 2002-11-27 16:29:42 Re: Using SHOW in PL/pgSQL

Browse pgsql-hackers by date

  From Date Subject
Next Message Achilleus Mantzios 2002-11-27 16:35:20 Re: FreeBSD, Linux: select, select count(*) performance
Previous Message Merlin Moncure 2002-11-27 16:26:30 Re: [PERFORM] Realtime VACUUM, was: performance of insert/delete/update

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2002-11-27 16:35:20 Re: FreeBSD, Linux: select, select count(*) performance
Previous Message Tom Lane 2002-11-27 16:15:58 Re: FreeBSD, Linux: select, select count(*) performance