Re: appropriate column for storing ipv4 address

From: Emre Hasegeli <emre(at)hasegeli(dot)com>
To: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>, jonathan vanasco <postgres(at)2xlp(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: appropriate column for storing ipv4 address
Date: 2017-03-02 10:12:52
Message-ID: CAE2gYzxnTyB0qqnuadXtosObimxq8G4JxJA3B7Jy0OwKr_VH6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Maybe it will be useful for you! Or maybe there is already some built-in way
> to treat cidr columns like ranges?

There is GiST operator class since version 9.4 and SP-GiST operator
class on version 9.6:

CREATE INDEX ON tracked_ip_address USING gist (ip_address inet_ops);

CREATE INDEX ON tracked_ip_address USING spgist (ip_address);

Performance would change depending on the dataset. I am more
confident from SP-GiST one.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message subash 2017-03-02 10:48:15 Re: Setup pgpool-II with streaming replication
Previous Message Neslisah Demirci 2017-03-02 08:54:32 Ynt: column "waiting" does not exist