From: Pomarede Nicolas <npomarede@corp.free.fr>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-performance@postgresql.org
Subject: Re: Best way to index IP data?
Date: Fri, 11 Jan 2008 23:43:58 +0100 (CET)
Message-ID: <Pine.LNX.4.64.0801112336500.30027@localhost> (raw)
In-Reply-To: <20080111222403.GA7527@crankycanuck.ca>
References: <200801101614.54729.kevin@kevinkempterllc.com>
<DA6DE53A-2F69-46F3-8C96-B341ADCDDFAF@blighty.com>
<36e682920801101541o7626bbddj428617144240c554@mail.gmail.com>
<Pine.LNX.4.64.0801111025390.30762@localhost>
<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>
On Fri, 11 Jan 2008, Andrew Sullivan wrote:
> On Fri, Jan 11, 2008 at 05:02:36PM -0500, Michael Stone wrote:
>
>> networks), but there's a conspicuous lack of a type for (hosts). I
>> suppose if you really are sure that you want to store hosts and not
>> networks
>
> Well, part of the trouble is that in the CIDR world, an IP without a netmask
> can be dangerously ambiguous. I can see why the design is as it is for that
> reason. (But I understand the problem.)
>
> A
>
Yes, in fact it all depends on the meaning you give to an IP.
If you want to store subnets, then you need an IP and a netmask, but if
you just want to store the IP of a particular equipment (that is, the IP
that will be refered to in the TCP/IP header), then there's no ambiguity,
you just need 4 bytes to describe this IP.
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.
Nicolas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: npomarede@corp.free.fr, ajs@crankycanuck.ca
Subject: Re: Best way to index IP data?
In-Reply-To: <Pine.LNX.4.64.0801112336500.30027@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox