X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 870A7D1B269 for ; Wed, 16 Jun 2004 09:57:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94910-09 for ; Wed, 16 Jun 2004 12:57:00 +0000 (GMT) Received: from ndl1mr1-a-fixed.sancharnet.in (ndl1mr1-a-fixed.sancharnet.in [61.0.0.45]) by svr1.postgresql.org (Postfix) with ESMTP id 96689D1B215 for ; Wed, 16 Jun 2004 09:56:55 -0300 (ADT) Received: from conversion-daemon.ndl1mr1-a-fixed.sancharnet.in by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 1.27 (built May 12 2004)) id <0HZE00M01JQXJJ@ndl1mr1-a-fixed.sancharnet.in> (original mail from sank89@sancharnet.in) for pgsql-admin@postgresql.org; Wed, 16 Jun 2004 18:26:36 +0530 (IST) Received: from [61.0.94.212] by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 1.27 (built May 12 2004)) with ESMTPA id <0HZE0047CJY3N4@ndl1mr1-a-fixed.sancharnet.in>; Wed, 16 Jun 2004 18:26:33 +0530 (IST) Date: Wed, 16 Jun 2004 18:22:38 +0530 From: "V i s h a l Kashyap @ [Sai Hertz And Control Systems]" Subject: Re: VARCHAR -vs- CHAR: huge performance difference? In-reply-to: <51429.63.227.74.41.1087347504.squirrel@webmail.stinkweasel.net> To: "C. Bensend" Cc: pgsql-admin@postgresql.org Reply-To: aspire420@hotpop.com Message-id: <40D04296.5060103@sancharnet.in> Organization: Sai Hertz And Control Systems Pvt Ltd MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) References: <51429.63.227.74.41.1087347504.squirrel@webmail.stinkweasel.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.9 tagged_above=0.0 required=5.0 tests=FROM_ENDS_IN_NUMS X-Spam-Level: X-Archive-Number: 200406/200 X-Sequence-Number: 13860 Dear C. Bensend wrote: > I am parsing and storing emails, so I have a lot of character string >data to worry about. In one particular table, I have 26 columns of type >varchar, with widths of 24-8192 characters. This is the table that is >giving me some pretty severe performance problems. > > For example, many of the statistics I run against these emails is a >simple count(), whether it be on a column or *. Right now, counting the >rows takes in excess of 3.5 seconds. OK, that's pretty slow. However, >there are only --> 24,000 <-- rows in this table! I could see it taking >a long time if I had 500,000 rows, or a million, but 24,000? > > > For similar post someone suggested to do a count like select count(*) from table where any = any limit 1 ; Try this look if thiers any performance increase. -- Regards, Vishal Kashyap Director / Lead Software Developer, Sai Hertz And Control Systems Pvt Ltd, http://saihertz.rediffblogs.com Yahoo IM: mailforvishal[ a t ]yahoo.com