Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C4DA39FA311 for ; Mon, 11 Dec 2006 06:33:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 79814-02-2 for ; Mon, 11 Dec 2006 06:32:45 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0102.google.com (nz-out-0506.google.com [64.233.162.224]) by postgresql.org (Postfix) with ESMTP id 689309FA2CC for ; Mon, 11 Dec 2006 06:32:45 -0400 (AST) Received: by nz-out-0102.google.com with SMTP id i11so737658nzh for ; Mon, 11 Dec 2006 02:32:44 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=d1GZgOxfBZ6bbJ8/Gep1yO0saHDBlNc3cis8WOAGZdILk+acr3+vlSqk0POAb2glwdXYEhZB4TUiURCtXE9cv4ujSnFMaGm+V+m47kstFKuggiHa9owx1Fg/VcJqfUwxnToGrZbzh3JcnmANR6dcEV7beVOwDwRb+DULD+SSmaY= Received: by 10.65.59.20 with SMTP id m20mr4485610qbk.1165833163869; Mon, 11 Dec 2006 02:32:43 -0800 (PST) Received: by 10.65.215.20 with HTTP; Mon, 11 Dec 2006 02:32:43 -0800 (PST) Message-ID: <8a0c7af10612110232y2fb416ffpdfa70f1b492388ae@mail.gmail.com> Date: Mon, 11 Dec 2006 08:32:43 -0200 From: "Daniel van Ham Colchete" To: pgsql-performance@postgresql.org Subject: Re: New to PostgreSQL, performance considerations In-Reply-To: <60515F4F-51D7-4F2F-A4A0-E59E219DF16A@purefiction.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8a0c7af10612101141n2c7727c3r2f92345753960808@mail.gmail.com> <430d92a20612101336r3de8862coe618277fccb4006a@mail.gmail.com> <8a0c7af10612101702i49b5a533v4a2300d90d9dae6b@mail.gmail.com> <430d92a20612101718o239dbf9dg990e784c17bf175a@mail.gmail.com> <8a0c7af10612101747j33b09ddft21d3341cc95dfaf5@mail.gmail.com> <60515F4F-51D7-4F2F-A4A0-E59E219DF16A@purefiction.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/214 X-Sequence-Number: 22270 On 12/11/06, Alexander Staubo wrote: > On Dec 11, 2006, at 02:47 , Daniel van Ham Colchete wrote: > > > I never understood what's the matter between the ASCII/ISO-8859-1/UTF8 > > charsets to a database. They're all simple C strings that doesn't have > > the zero-byte in the midlle (like UTF16 would) and that doesn't > > require any different processing unless you are doing case insensitive > > search (them you would have a problem). > > That's not the whole story. UTF-8 and other variable-width encodings > don't provide a 1:1 mapping of logical characters to single bytes; in > particular, combination characters opens the possibility of multiple > different byte sequences mapping to the same code point; therefore, > string comparison in such encodings generally cannot be done at the > byte level (unless, of course, you first acertain that the strings > involved are all normalized to an unambiguous subset of your encoding). > > PostgreSQL's use of strings is not limited to string comparison. > Substring extraction, concatenation, regular expression matching, up/ > downcasing, tokenization and so on are all part of PostgreSQL's small > library of text manipulation functions, and all deal with logical > characters, meaning they must be Unicode-aware. > > Alexander. > You're right. I was thinking only about my cases that takes the Unicode normatization for granted and doesn't use regexp/tokenization/... Thanks Best Daniel