Re: count * performance issue

From: "sathiya psql" <sathiya(dot)psql(at)gmail(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: count * performance issue
Date: 2008-03-06 07:06:48
Message-ID: f966c2ee0803052306h5e5481bdk489b2c01d0ab930b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=205756.95..205756.95 rows=1 width=0) (actual time=
114675.042..114675.042 rows=1 loops=1)
-> Seq Scan on call_log (cost=0.00..193224.16 rows=5013112 width=0)
(actual time=11.754..91429.594 rows=5061619 loops=1)
Filter: (call_id > 0)
Total runtime: 114699.797 ms
(4 rows)

it is now taking 114 seconds, i think because of load in my system.... any
way will you explain., what is this COST, actual time and other stuffs....

On Thu, Mar 6, 2008 at 12:27 PM, A. Kretschmer <
andreas(dot)kretschmer(at)schollglas(dot)com> wrote:

> am Thu, dem 06.03.2008, um 12:17:55 +0530 mailte sathiya psql folgendes:
> > TRIGGER i can use if i want the count of the whole table, but i require
> for
> > some of the rows with WHERE condition....
> >
> > so how to do that ???
>
> Okay, in this case a TRIGGER are a bad idea. You can use an INDEX on
> this row. Can you show us the output for a EXPLAIN ANALYSE SELECT
> count(*) from <your_table> WHERE <your_row> = ... ?
>
>
> Andreas
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
>
> http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=pgsql-performance
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joshua D. Drake 2008-03-06 07:06:50 Re: oid...any optimizations
Previous Message sathiya psql 2008-03-06 07:02:01 oid...any optimizations