Re: SQL question....

From: Karl Denninger <karl(at)denninger(dot)net>
To: Steve Midgley <public(at)misuse(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL question....
Date: 2008-05-22 01:12:34
Message-ID: 4834C882.2060201@denninger.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Steve Midgley wrote:
> At 12:20 PM 5/21/2008, pgsql-sql-owner(at)postgresql(dot)org wrote:
>> Date: Wed, 21 May 2008 06:39:11 -0500
>> From: Karl Denninger <karl(at)denninger(dot)net>
>> To: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
>> Cc: pgsql-sql(at)postgresql(dot)org
>> Subject: Re: SQL question....
>> Message-ID: <483409DF(dot)7050905(at)denninger(dot)net>
>>
>> > Also, if you don't have it already, you may create an index on IP
>> > column for better performance.
>> > Mail sent from my BlackLaptop device
>> Its a very large table and is indexed already...
>
> Not to completely beat this thing to death, but are you using an inet
> or other custom datatype for this? I think if you index ip's using a
> custom data type and search/group for specific octets, you'll get much
> better performance than just searching via a regular b-tree string
> index..
>
> http://www.postgresql.org/docs/8.3/static/datatype-net-types.html
>
> Steve
>
I'm using Inet but the searches/replaces that need to be done are all
done on the full address.

In this case it doesn't do a bit of good because the entire table has to
be sequential scanned.

Karl Denninger (karl(at)denninger(dot)net)
http://www.denninger.net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Nacef LABIDI 2008-05-22 15:15:12 Substract queries
Previous Message Steve Midgley 2008-05-22 00:42:14 Re: SQL question....