From: siganos@gmail.com
To: pgsql-sql@postgresql.org
Subject: Re: Question about a CIDR based query
Date: 26 Jun 2004 16:06:15 -0700
Message-ID: <ebba5a93.0406261506.7a0f7558@posting.google.com> (raw)
References: <ebba5a930406241343173046c7@mail.gmail.com>
<200406250900.08312.josh@agliodbs.com>
I did a vacuum analyze before I run the following explain
June_03=# explain select * from tmp where route >>='62.1.1.0/24';
QUERY PLAN
----------------------------------------------------------------
Seq Scan on tmp (cost=0.00..606.60 rows=14544 width=33)
Filter: (route >>= '62.1.1.0/24'::cidr)
(2 rows)
The select returns just one route,
Thanks
josh@agliodbs.com (Josh Berkus) wrote in message news:<200406250900.08312.josh@agliodbs.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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
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: siganos@gmail.com
Subject: Re: Question about a CIDR based query
In-Reply-To: <ebba5a93.0406261506.7a0f7558@posting.google.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