From: Richard Huxton <dev@archonet.com>
To: Woody Woodring <george.woodring@iglass.net>
To: pgsql-performance@postgresql.org
Subject: Re: Help with query plan inconsistencies
Date: Wed, 24 Mar 2004 16:44:39 +0000
Message-ID: <200403241644.39363.dev@archonet.com> (raw)
In-Reply-To: <D130F4682AF7D21187FC00805FCB0F1310C3F13C@sphere.istructure.com>
References: <D130F4682AF7D21187FC00805FCB0F1310C3F13C@sphere.istructure.com>
On Tuesday 23 March 2004 18:49, Woody Woodring wrote:
> Hello,
>
> I am using postgres 7.4.2 as a backend for geocode data for a mapping
> application. My question is why can't I get a consistent use of my indexes
> during a query, I tend to get a lot of seq scan results.
I'm not sure it wants to be using the indexes all of the time.
> Nested Loop Left Join (cost=0.00..23433.18 rows=1871 width=34) (actual
> time=0.555..5095.434 rows=3224 loops=1)
> Total runtime: 5100.028 ms
> Nested Loop Left Join (cost=0.00..76468.90 rows=9223 width=34) (actual
> time=0.559..17387.427 rows=19997 loops=1)
> Total runtime: 17416.501 ms
> Nested Loop Left Join (cost=0.00..29160.02 rows=2327 width=34) (actual
> time=0.279..510.773 rows=5935 loops=1)
> Total runtime: 516.782 ms
#1 = 630 rows/sec (with index on cable_billing)
#2 = 1,148 rows/sec (without index)
#3 = 11,501 rows/sec (with index)
The third case is so much faster, I suspect the data wasn't cached at the
beginning of this run.
In any case #2 is faster than #1. If the planner is getting things wrong,
you're not showing it here.
--
Richard Huxton
Archonet Ltd
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-performance@postgresql.org
Cc: dev@archonet.com, george.woodring@iglass.net
Subject: Re: Help with query plan inconsistencies
In-Reply-To: <200403241644.39363.dev@archonet.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