Re: Best way to index IP data?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Best way to index IP data?
Date: 2008-01-11 21:37:10
Message-ID: 20080111213710.GD8260@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Michael Stone wrote:
> On Fri, Jan 11, 2008 at 03:07:38PM -0500, Tom Lane wrote:
>> Michael Stone <mstone+postgres(at)mathom(dot)us> writes:
>>> Well, a native IPv6 type would also be nice; inet is ridiculously bloated
>>> for both IPv4 *and* IPv6.
>>
>> Nonsense. 3 bytes overhead on a 16-byte address is not "ridiculously
>> bloated", especially if you want a netmask with it.
>
> Big if, no? There's a very large set of users that *don't* want/need a
> netmask, which is why the topic keeps coming back. (Also, according to the
> docs, inet requires 24 bytes, which is 50% more than needed; is that not
> correct?)

So what this means is that our type oughta be optimized. How about
having a separate bit to indicate whether there is a netmask or not, and
chop the storage earlier. (I dunno if this already done)

Also, with packed varlenas the overhead is reduced AFAIK.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Michael Stone 2008-01-11 21:40:48 Re: Best way to index IP data?
Previous Message Michael Stone 2008-01-11 21:32:05 Re: Best way to index IP data?