X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0F9179DCA84 for ; Wed, 8 Feb 2006 11:54:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80742-01 for ; Wed, 8 Feb 2006 11:54:08 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from gghcwest.com (adsl-71-128-90-172.dsl.pltn13.pacbell.net [71.128.90.172]) by postgresql.org (Postfix) with ESMTP id AC53C9DCA6E for ; Wed, 8 Feb 2006 11:54:01 -0400 (AST) Received: from [192.246.145.82] (pismo.gghcwest.com [192.246.145.82]) by gghcwest.com (8.12.10/8.12.9) with ESMTP id k18Fs2md021394; Wed, 8 Feb 2006 07:54:03 -0800 Subject: Re: Size and performance hit from using UTF8 vs. ASCII? From: "Jeffrey W. Baker" To: Ron Cc: pgsql-performance@postgresql.org In-Reply-To: <7.0.1.0.2.20060208090456.035842d0@earthlink.net> References: <7.0.1.0.2.20060208090456.035842d0@earthlink.net> Content-Type: text/plain Date: Wed, 08 Feb 2006 07:54:01 -0800 Message-Id: <1139414042.8707.7.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.5.90 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200602/70 X-Sequence-Number: 17056 On Wed, 2006-02-08 at 09:11 -0500, Ron wrote: > I'm specifically interested in the default C Locale; but if there's a > difference in the answer for other locales, I'd like to hear about > that as well. The size hit will be effectively zero if your data is mainly of the ASCII variety, since ASCII printable characters to UTF-8 is an identity transform. However anything involving string comparisons, including equality, similarity (LIKE, regular expressions), or any other kind of comparison (ORDER BY, GROUP BY) will be slower. In my experience the performance hit varies from zero to 100% in CPU time. UTF-8 is never faster that ASCII, as far as I know. However, if you need UTF-8 then you need it, and there's no point in worrying about the performance hit. You may as well just do two benchmark runs with your database initialized in either character set to see for yourself. -jwb