Question about a CIDR based query

From: Georgos Siganos <siganos(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Question about a CIDR based query
Date: 2004-06-24 20:43:08
Message-ID: ebba5a930406241343173046c7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

Consider that I have the following table:

Create Table tmp(
            route_id     int    NOT NULL,
            route         cidr   NOT NULL,
            Data         varchar(100) NOT NULL)

The table contains ~40,000 routes and I have an index on route.

The query I am interested in is:

select * from tmp where route >>= some_cidr

The index on route is not used and I get a sequential scan. The index is
used only for the <<= operator.

Any idea how I can make the query run faster?

Thanks,
George

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Phil Endecott 2004-06-24 20:55:47 Re: Normalising an existing table - how?
Previous Message Andrew Sullivan 2004-06-24 19:27:14 Re: feature request ?