Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C8AC16369DB for ; Tue, 10 Mar 2009 21:19:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 99502-01 for ; Tue, 10 Mar 2009 21:19:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 438B3634CBE for ; Tue, 10 Mar 2009 21:16:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n2B0Gtkc017477; Tue, 10 Mar 2009 20:16:55 -0400 (EDT) To: "Steve McLellan" cc: pgsql-performance@postgresql.org Subject: Re: Query performance over a large proportion of data In-reply-to: <1ca6422a7addad0207f758f54300dd0b.squirrel@semichrome.net> References: <1ca6422a7addad0207f758f54300dd0b.squirrel@semichrome.net> Comments: In-reply-to "Steve McLellan" message dated "Tue, 10 Mar 2009 16:12:17 -0500" Date: Tue, 10 Mar 2009 20:16:55 -0400 Message-ID: <17476.1236730615@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/89 X-Sequence-Number: 33011 "Steve McLellan" writes: > lc_messages = 'en_US.UTF-8' > lc_monetary = 'en_US.UTF-8' > lc_numeric = 'en_US.UTF-8' > lc_time = 'en_US.UTF-8' BTW, aside from the points already made: the above indicates that you initialized your database in en_US.utf8 locale. This is not necessarily a good decision from a performance standpoint --- you might be much better off with C locale, and might even prefer it if you favor ASCII-order sorting over "dictionary" sorting. utf8 encoding might create some penalties you don't need too. This all depends on a lot of factors you didn't mention; maybe you actually need utf8 data, or maybe your application doesn't do many string comparisons and so isn't sensitive to the speed of strcoll() anyway. But I've seen it be a gotcha for people moving from MySQL, which AFAIK doesn't worry about honoring locale-specific sort order. regards, tom lane