Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 78C4E2E2EF4 for ; Thu, 6 Mar 2008 02:58:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 14738-02 for ; Thu, 6 Mar 2008 02:58:23 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by postgresql.org (Postfix) with ESMTP id 6F8CB2E032C for ; Thu, 6 Mar 2008 02:58:23 -0400 (AST) Received: from webserv.wug.de ([194.25.154.138]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis) id 0ML29c-1JXA3S2FLn-0001gk; Thu, 06 Mar 2008 07:58:22 +0100 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1JXA34-0005yO-00 for pgsql-performance@postgresql.org; Thu, 06 Mar 2008 07:57:50 +0100 Date: Thu, 6 Mar 2008 07:57:50 +0100 From: "A. Kretschmer" To: pgsql-performance@postgresql.org Subject: Re: count * performance issue Message-ID: <20080306065750.GD21084@a-kretschmer.de> References: <20080306060829.GA21084@a-kretschmer.de> <47CF8EA6.8070503@mark.mielke.cc> <20080306063643.GB21084@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: V01U2FsdGVkX1/rD2Y4S8TWF3oyJHIPnRpNs/Kq0Z/D75QmVLb ufD8wh3t4+0YhPfDRoQjstn6jcEeigbz6f07pXYIVWQyKlC8yR JlX98Zc4JqymSeDLbx7F5Y9VH9j/xS1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/102 X-Sequence-Number: 29056 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 WHERE = ... ? Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net