Re: Efficiently searching for CIDRs containing an IP address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"David F. Skoll" <dfs@xxxxxxxxxxxxxxxxxx> writes:
> I want to efficiently support queries like this:
> SELECT * FROM networks WHERE '128.3.4.5' <<= iprange;
> There doesn't seem to be any indexing mechanism in core PostgresSQL that
> supports this; it always does a sequential scan.

Yeah.  Something that's been on the TODO list for a long time is to put
together a GIST index opclass that handles this sort of thing.  I have
not looked at ip4r in detail, but it seems like whatever that's doing
for index support could be transposed to the built-in types.  Or you
could base it on the contrib/seg indexing code (but beware that we've
recently found serious performance bugs in the latter).

			regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux