X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 448E5D1BACA for ; Tue, 24 Feb 2004 16:45:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 02416-05 for ; Tue, 24 Feb 2004 12:45:15 -0400 (AST) Received: from easily.co.uk (mercury0.easily.co.uk [213.161.76.90]) by svr1.postgresql.org (Postfix) with ESMTP id 8E36FD1BAD5 for ; Tue, 24 Feb 2004 12:45:13 -0400 (AST) Received: from [213.152.63.90] (account f4vo5dsy5djd HELO chuckie.co.uk) by easily.co.uk (CommuniGate Pro SMTP 4.1.3) with ESMTP id 50702857; Tue, 24 Feb 2004 16:45:01 +0000 Message-ID: <403B7F89.5030902@chuckie.co.uk> Date: Tue, 24 Feb 2004 16:44:57 +0000 From: Nick Barr User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Eric Jain , Steve Atkins , pgsql-performance Subject: Re: Slow join using network address function References: <000701c3fa02$e4e3d180$c300000a@caliente> <20040223160734.GA11052@gp.word-to-the-wise.com> <001d01c3face$bca62d40$c300000a@caliente> <22239.1077636202@sss.pgh.pa.us> In-Reply-To: <22239.1077636202@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/279 X-Sequence-Number: 5803 Tom Lane wrote: >"Eric Jain" writes: > > >>> is a datatype that contains >>>a range of IPv4 addresses, and which has the various operators to >>>make it GIST indexable. >>> >>> > > > >>Great, this looks very promising. >> >> > > > >>>No cast operators between ipr and inet types. >>> >>> > > > >>Any way to work around this, short of dumping and reloading tables? >> >> > >Wouldn't it be better to implement the GIST indexing operators of that >package on the standard datatypes? It wasn't apparent to me what "range >of IP addresses" does for you that isn't covered by "CIDR subnet" for >real-world cases. > > regards, tom lane > >---------------------------(end of broadcast)--------------------------- >TIP 8: explain analyze is your friend > > We currently only allow access to one of our apps based on IP address. These IPs are stored one per row in a single table, but often represent a contiguous piece of IP space, but does not represent a full subnet. The current CIDR subnet has the limitation that it will only allow full subnets, i.e. every IP address in 192.168.1.0/24. For example: 192.168.1.15 -> 192.168.1.31 This range cannot be represented by a CIDR subnet, or it might be able to but I really dont want to figure it out each time. However this new type allows us to store this range as one row. It allows an arbitrary range of IP addresses, not just those in a specific subnet. I would see this as a useful inclusion whether in the main src tree or in contrib and we will probably be using it when we get to "mess" with the database schema for this app in the next few months, in fact I have already inserted it into our PG source tree ;-). Nick P.S. We are not responsible for the IP address ranges, we just get told what they are.