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 A60049DCA52 for ; Sun, 12 Feb 2006 22:28:08 -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 86254-07 for ; Sun, 12 Feb 2006 22:28:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (serval.logix-tt.com [213.239.221.42]) by postgresql.org (Postfix) with ESMTP id 648F59DC9FC for ; Sun, 12 Feb 2006 22:28:04 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (Mdf2d.m.pppool.de [89.49.223.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id BF44324407F; Mon, 13 Feb 2006 03:28:08 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 4800A184B3AD8; Sun, 12 Feb 2006 22:04:18 +0100 (CET) Message-ID: <43EFA2D2.1050609@logix-tt.com> Date: Sun, 12 Feb 2006 22:04:18 +0100 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Aaron Turner Cc: "Jim C. Nasby" , "Matthew T. O'Connor" , pgsql-performance@postgresql.org Subject: Re: 10+hrs vs 15min because of just one index References: <1ca1c1410602100016p2b5fdcc4wbf45612d7efc5fdf@mail.gmail.com> <43ECC9BF.2030107@zeut.net> <1ca1c1410602100924s191e7cddo4bda80d8f8d7cb6d@mail.gmail.com> <20060211212453.GT57845@pervasive.com> <1ca1c1410602112358h1e0e9696lff8f172769dc587e@mail.gmail.com> In-Reply-To: <1ca1c1410602112358h1e0e9696lff8f172769dc587e@mail.gmail.com> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.121 required=5 tests=[AWL=0.121] X-Spam-Score: 0.121 X-Spam-Level: X-Archive-Number: 200602/139 X-Sequence-Number: 17125 Hi, Aaron, Aaron Turner wrote: > 4) Does decoding the data (currently base64) and storing the binary > data improve the distribution of the index, thereby masking it more > efficent? Yes, but then you should not use varchar, but a bytea. If your data is some numer internally, numeric or decimal may be even better. If most of your data is different in the first 8 bytes, it may also make sense to duplicate them into a bigint, and create the bigint on them. Then you can use AND in your query to test for the 8 bytes (uses index) and the bytea. Ugly, but may work. HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org