Re: indices and cidr/inet type

From: Richard Welty <rwelty(at)averillpark(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: indices and cidr/inet type
Date: 2003-08-05 20:55:48
Message-ID: E19k8qS-000427-Tc@skipper.averillpark.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 05 Aug 2003 15:09:00 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Richard Welty <rwelty(at)averillpark(dot)net> writes:
> > what type of index is recommended when the dominant lookup on a field
> is
> > '<networkaddress>' << ipblock
>
> I don't think we have a suitable index type at the moment; or more
> accurately, we don't have a suitable operator class. It would be an
> interesting exercise to write an inet opclass for either rtree or GiST.
> I'm not sure which one would be more suitable, but probably you could
> handle << with one or the other.

hmmm. where should i go looking for sample code implementing operator
classes as an example?

by way of context, i do a _lot_ of email work, and my client of the moment
is the owner of an ISP who is migrating his user & system configurations
into postgresql as much as he possibly can. this includes his list of
allowed mail relay hosts and locally blacklisted spam sources. while the
tables aren't that large right now and the planner probably wouldn't use an
index even if one existed, i can definitely see fast << operations on CIDR
and INET types as being more than a little valuble in cases where things do
get large.

richard
--
Richard Welty rwelty(at)averillpark(dot)net
Averill Park Networking 518-573-7592
Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-08-05 21:08:05 Re: multiple insert into's (may be NEWBIE question)
Previous Message Ron Johnson 2003-08-05 20:11:08 Knowing how many records I just inserted