Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D4FC9475EAA for ; Tue, 21 Jan 2003 00:34:30 -0500 (EST) Received: from pd6mo2so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by postgresql.org (Postfix) with ESMTP id 3B9BA475DD0 for ; Tue, 21 Jan 2003 00:34:30 -0500 (EST) Received: from pd4mr2so.prod.shaw.ca (pd4mr2so-qfe3.prod.shaw.ca [10.0.141.213]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0H91007EFU5NU5@l-daemon> for pgsql-sql@postgresql.org; Mon, 20 Jan 2003 22:34:35 -0700 (MST) Received: from pn2ml3so.prod.shaw.ca (pn2ml3so-qfe0.prod.shaw.ca [10.0.121.147]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0H9100GBUU5NVR@l-daemon> for pgsql-sql@postgresql.org; Mon, 20 Jan 2003 22:34:35 -0700 (MST) Received: from kimiko (h24-78-132-76.vc.shawcable.net [24.78.132.76]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.6 (built Apr 26 2002)) with SMTP id <0H9100K2KU5MHS@l-daemon> for pgsql-sql@postgresql.org; Mon, 20 Jan 2003 22:34:35 -0700 (MST) Date: Mon, 20 Jan 2003 21:32:25 -0800 From: Vernon Wu Subject: Re: performance question In-reply-to: <20147.1043095100@sss.pgh.pa.us> To: mlennert@club.worldonline.be, Tom Lane Cc: pgsql-sql@postgresql.org Reply-To: vernonw@gatewaytech.com Message-id: MIME-version: 1.0 X-Mailer: Opera 6.05 build 1140 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 (Normal) X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/311 X-Sequence-Number: 11176 20/01/2003 12:38:20 PM, Tom Lane wrote: >"Moritz Lennert" writes: >> One question I asked myself is whether the use of char(2) is the best >> option. > >It may not be, particularly if you are running in a non-English locale. >Comparisons will invoke the standard library routine strcoll(), which is >depressingly slow in some locales, at least on some platforms. > In the case of selection operations involving multiple tables joined by userid that can be in various languages, is a potential performance trouble spot? Considering the number of tables anywhere from ten to twenty. >> The column (and most others in the table) contains codes that >> designate different characteristics (for ex. in a column 'sex' one would >> find '1'=male, '2'=female). > >If you are using numeric codes you are surely better off storing them >as integer or perhaps smallint (integer is less likely to create type >mismatch headaches, though). In the above example you are getting the >worst of both worlds: there's no mnemonic value in your data entries, >*and* you're paying for textual comparisons. > > regards, tom lane > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >