Re: Best way to index IP data?

From: Steve Atkins <steve(at)blighty(dot)com>
To: PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Best way to index IP data?
Date: 2008-01-11 16:11:15
Message-ID: 0B56B6A9-F22E-4098-914D-596F2F3A1CAF@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On Jan 11, 2008, at 7:19 AM, Tom Lane wrote:

> Pomarede Nicolas <npomarede(at)corp(dot)free(dot)fr> writes:
>> As ip4r seems to work very well with postgresql, is there a
>> possibility to
>> see it merged in postgresql, to have a native 4 bytes IPv4 address
>> date
>> type ?
>
> Given that the world is going to IPv6 in a few years whether you
> like it
> or not, that seems pretty darn short-sighted to me.
>
> What would make sense IMHO is to adapt the improved indexing support
> in
> ip4r to work on the native inet/cidr types.

Can't be done. The native types are too limited to be effectively
indexed
in that way - they cannot represent arbitrary ranges. ip4r started
with me
trying to retrofit decent indexing onto the cidr type and failing
miserably.

I'll likely be rolling out ip6r/ipr sometime in 2008, as users are
beginning to
express an interest. But even then I don't expect it to replace the inet
and cidr types in core, because it isn't compatible with them.

I'd actually support removing inet/cidr from core completely in the
longer
run. Postgresql is extensible, so we really don't need types used only
by niche users in core, once we have pgfoundry and something like
mysqludf.org/CPAN. But that's a longer term thought.

Cheers,
Steve

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joshua D. Drake 2008-01-11 16:18:21 Re: Best way to index IP data?
Previous Message Pomarede Nicolas 2008-01-11 15:55:30 Re: Best way to index IP data?