Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AF5622E0097 for ; Fri, 11 Jan 2008 20:51:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 59010-07 for ; Fri, 11 Jan 2008 20:51:22 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1578B2E008E for ; Fri, 11 Jan 2008 20:51:22 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0C0pJgd028999; Fri, 11 Jan 2008 19:51:19 -0500 (EST) To: Pomarede Nicolas cc: Andrew Sullivan , pgsql-performance@postgresql.org Subject: Re: Best way to index IP data? In-reply-to: References: <200801101614.54729.kevin@kevinkempterllc.com> <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> Comments: In-reply-to Pomarede Nicolas message dated "Fri, 11 Jan 2008 23:43:58 +0100" Date: Fri, 11 Jan 2008 19:51:19 -0500 Message-ID: <28998.1200099079@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/93 X-Sequence-Number: 28332 Pomarede Nicolas writes: > And it's true for IPv6 too, storing an IP that refer to an end point and > not a subnet is requiring twice as much data as needed, because the > netmask would always be ff:ff:ff:..:ff > So, for people dealing with large database of IPs, it would be nice to be > able to save 50% of the corresponding disk/cache/ram space for these IPs. There seem to be a number of people in this thread laboring under the illusion that we store a netmask as a mask. It's a bit count (think /32 or /128) and occupies a whole one byte on disk. Killer overhead, for sure. regards, tom lane