pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Georgos Siganos <siganos@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Question about a CIDR based query
Date: Fri, 25 Jun 2004 09:00:08 -0700
Message-ID: <200406250900.08312.josh@agliodbs.com> (raw)
In-Reply-To: <ebba5a930406241343173046c7@mail.gmail.com>
References: <ebba5a930406241343173046c7@mail.gmail.com>

Georgos,

> select * from tmp where route >>= some_cidr

Can you post an EXPLAIN ANALYZE for this?   And when's the last time you ran 
ANALYZE on the table?

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

Most likely Postgres thinks that the >>= query is returning 60% of your table, 
which makes indexes useless.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



view thread (6+ messages)  latest in thread

Message-ID: <200406250900.08312.josh@agliodbs.com>
Permalink:  ../200406250900.08312.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200406250900.08312.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, siganos@gmail.com
  Subject: Re: Question about a CIDR based query
  In-Reply-To: <200406250900.08312.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox