pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Atkins <steve@blighty.com>
To: Pgsql-Performance ((E-mail)) <pgsql-performance@postgresql.org>
Subject: Re: ip address data type
Date: Mon, 24 Apr 2006 16:40:16 -0700
Message-ID: <AA27228F-6E88-4DB0-845C-D02F9B1FF4D9@blighty.com> (raw)
In-Reply-To: <6992E470F12A444BB787B5C937B9D4DF0406B11B@ca-mail1.cis.local>
References: <6992E470F12A444BB787B5C937B9D4DF0406B11B@ca-mail1.cis.local>


On Apr 24, 2006, at 3:45 PM, Sriram Dandapani wrote:

> Hi
>
>
>
> I have queries that use like operators and regex patterns to  
> determine if an ip address is internal or external (this is against  
> a table with say 100 million distinct ip addresses).
>
>
>
> Does the inet data type offer comparison/search performance  
> benefits over plain text for ip addresses..
It's probably better than text-based, but it's hard to be worse than  
regex and like.

Depending on your exact needs http://pgfoundry.org/projects/ip4r/ may be
interesting, and I've also found pretty good behavior by mapping an IP
address onto a 2^31 offset integer.

Cheers,
   Steve



view thread (4+ messages)  latest in thread

Message-ID: <AA27228F-6E88-4DB0-845C-D02F9B1FF4D9@blighty.com>
Permalink:  ../AA27228F-6E88-4DB0-845C-D02F9B1FF4D9@blighty.com/
Also on:    postgresql.org/message-id/AA27228F-6E88-4DB0-845C-D02F9B1FF4D9@blighty.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: steve@blighty.com
  Subject: Re: ip address data type
  In-Reply-To: <AA27228F-6E88-4DB0-845C-D02F9B1FF4D9@blighty.com>
  References: <6992E470F12A444BB787B5C937B9D4DF0406B11B@ca-mail1.cis.local> <AA27228F-6E88-4DB0-845C-D02F9B1FF4D9@blighty.com>

* 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