Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 50BAC2E2F88 for ; Thu, 6 Mar 2008 03:18:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 22724-02 for ; Thu, 6 Mar 2008 03:18:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by postgresql.org (Postfix) with ESMTP id 772672E1D81 for ; Thu, 6 Mar 2008 03:18:17 -0400 (AST) Received: from webserv.wug.de ([194.25.154.138]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1JXAMp3Qjz-0004LR; Thu, 06 Mar 2008 08:18:16 +0100 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1JXAMp-0006Bw-00 for pgsql-performance@postgresql.org; Thu, 06 Mar 2008 08:18:15 +0100 Date: Thu, 6 Mar 2008 08:18:15 +0100 From: "A. Kretschmer" To: pgsql-performance@postgresql.org Subject: Re: count * performance issue Message-ID: <20080306071814.GG21084@a-kretschmer.de> References: <20080306060829.GA21084@a-kretschmer.de> <47CF8EA6.8070503@mark.mielke.cc> <20080306063643.GB21084@a-kretschmer.de> <20080306065750.GD21084@a-kretschmer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX18xcTLgV/h9OuZM90mPgN1zH2Cz90xT+YkIJ62 o3HYpYP8Z1JKYAH4M6gsENgfCwV8/XAn9nO391JZ09eEXLOyNa sTfL2h8OJ39z6hYSDvmu+hci9GXrxP5 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/107 X-Sequence-Number: 29061 am Thu, dem 06.03.2008, um 12:36:48 +0530 mailte sathiya psql folgendes: > > 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) 'call_id > 0' are your where-condition? An INDEX can't help, all rows with call_id > 0 are in the result, and i guess, that's all records in the table. > > > 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.... 08:16 < akretschmer> ??explain 08:16 < rtfm_please> For information about explain 08:16 < rtfm_please> see http://explain-analyze.info 08:16 < rtfm_please> or http://www.depesz.com/index.php/2007/08/06/better-explain-analyze/ 08:16 < rtfm_please> or http://www.postgresql.org/docs/current/static/sql-explain.html and http://redivi.com/~bob/oscon2005_pgsql_pdf/OSCON_Explaining_Explain_Public.pdf Read this to learn more about explain. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net