Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6902D6329C0 for ; Fri, 3 Sep 2010 08:00:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 33101-10 for ; Fri, 3 Sep 2010 11:00:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id E1A906318F3 for ; Fri, 3 Sep 2010 08:00:09 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OrU04-0001wN-LO for pgsql-docs@postgresql.org; Fri, 03 Sep 2010 13:00:04 +0200 Received: from 82.138.94.34 ([82.138.94.34]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Sep 2010 13:00:04 +0200 Received: from sylvain by 82.138.94.34 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Sep 2010 13:00:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-docs@postgresql.org From: Sylvain Rabot Subject: Re: Correction: datatypes are not "faster" Date: Fri, 03 Sep 2010 12:33:06 +0200 Lines: 59 Message-ID: <1283509986.6008.55.camel@isis.agematis.loc> References: <4C80208B.4060908@agliodbs.com> <15330.1283465619@sss.pgh.pa.us> <4C802428.5000504@agliodbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 82.138.94.34 In-Reply-To: <4C802428.5000504@agliodbs.com> X-Mailer: Evolution 2.28.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.746 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_NUMERIC_HELO=1.164, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/33 X-Sequence-Number: 6023 On Thu, 2010-09-02 at 15:24 -0700, Josh Berkus wrote: > >> This paragraph leaves a *lot* to be desired from an accuracy perspecti= ve > >=20 > > Really? Exactly which statements will you claim are incorrect? >=20 > That the int type is definitely faster on all platforms regardless of > circumstances. Especially the circumstance where the user really needs > a bigint and is doing some wonky workaround to use int instead, like the > newbie I'm chatting with on IRC right now, who did so specifically > because of that page of the docs. How do you know that the newbie, as you call him, needs a bigint. He was only trying to optimize his database according to his needs and what he read on the documentation. He might not be a postgresql master but at least he tries to use postgresql at its best. Being wrong does not make him a newbie but someone who learnt something which is a pretty common thing in computer science. The "newbie". >=20 > Besides which, datatypes are not "faster". Specific operations with > them may be faster. They may require less storage and less RAM. But > if we call them "faster", then we're contributing to application > developer ignorance. >=20 > > I notice that your proposed rewrite omits the bit about bigint being > > slower, which I can only conclude means you haven't tested on any > > 32-bit platforms lately. >=20 > Hmmm. Yes, but that's more of an exception now than it is a common > circumstance. Change this: >=20 > "On very minimal operating systems the bigint type might not function > correctly, because it relies on compiler support for eight-byte > integers. On such machines, bigint acts the same as integer, but still > takes up eight bytes of storage. (We are not aware of any modern > platform where this is the case.)" >=20 > To this: >=20 > On 32-bit operating systems, or when PostgreSQL is complied 32-bit, > operations using bigint can be significantly slower than those with > integer. On very minimal operating systems the bigint type might not > function correctly, because it relies on compiler support for eight-byte > integers. On such machines, bigint acts the same as integer, but still > takes up eight bytes of storage. (We are not aware of any modern > platform where this is the case.) >=20 >=20 >=20 > --=20 > -- Josh Berkus > PostgreSQL Experts Inc. > http://www.pgexperts.com >=20