Re: Best way to index IP data?
От | Pomarede Nicolas |
---|---|
Тема | Re: Best way to index IP data? |
Дата | |
Msg-id | Pine.LNX.4.64.0801112336500.30027@localhost обсуждение исходный текст |
Ответ на | Re: Best way to index IP data? (Andrew Sullivan <ajs@crankycanuck.ca>) |
Ответы |
Re: Best way to index IP data?
|
Список | pgsql-performance |
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
В списке pgsql-performance по дате отправления: