Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 581F72E44AD for ; Fri, 11 Jan 2008 19:01:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 21575-06 for ; Fri, 11 Jan 2008 19:01:21 -0400 (AST) Received: from main1.mycybernet.net (main1.mycybernet.net [209.222.63.135]) by postgresql.org (Postfix) with ESMTP id D6A572E44A7 for ; Fri, 11 Jan 2008 19:01:20 -0400 (AST) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=crankycanuck.ca) by main1.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1JDSrz-0004tG-SF for pgsql-performance@postgresql.org; Fri, 11 Jan 2008 18:00:59 -0500 Received: by crankycanuck.ca (Postfix, from userid 1000) id 471CA4FFE2; Fri, 11 Jan 2008 18:00:55 -0500 (EST) Date: Fri, 11 Jan 2008 18:00:55 -0500 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: Best way to index IP data? Message-ID: <20080111230055.GB7618@crankycanuck.ca> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <36e682920801101541o7626bbddj428617144240c554@mail.gmail.com> <13179.1200064791@sss.pgh.pa.us> <20080111162747.GT5294@mathom.us> <24044.1200082058@sss.pgh.pa.us> <20080111212703.GU5294@mathom.us> <20080111213710.GD8260@alvh.no-ip.org> <20080111220235.GX5294@mathom.us> <20080111222403.GA7527@crankycanuck.ca> <1259C7B1-C948-4326-B827-849C64B61A16@blighty.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1259C7B1-C948-4326-B827-849C64B61A16@blighty.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/84 X-Sequence-Number: 28323 On Fri, Jan 11, 2008 at 02:38:27PM -0800, Steve Atkins wrote: > I don't think there's ambiguity about what an dotted-quad without a > netmask > means, and hasn't been for a long time. Am I missing something? Well, maybe. The problem is actually that, without a netmask under CIDR, the address alone isn't really enough. You have to have a netmask to get the packets to the destination. As it happens, we have some nice conventions, defined in the RFCs, for how to interpret hosts with no netmask; note though that some of those are only for humans. Or, to put it another way, without context, a dotted-quad is insufficient on its own. What you're really arguing is that the context ought to be storable somewhere else (maybe in a human's brain). I'm not suggesting that's wrong, but I can see the "correctness" argument that someone might have made to get to the datatype as it exists. I think calling it "needless bloat" is just holding it to the wrong criteria. If you look at the binary wire data, that netmask is always represented in some sense. It can sometimes be more compact than the general-purpose data type, though, no question. This is why somewhere in this thread someone talked about optimisation: there certainly are ways to make these things more compact. A