pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: PostgreSQL ignores my indexes
Date: Wed, 23 Feb 2005 09:25:26 -0500
Message-ID: <20050223142526.GA9072@phlogiston.dyndns.org> (raw)
In-Reply-To: <53775.193.162.192.11.1109167312.squirrel@webmail.tuffmail.net>
References: <53775.193.162.192.11.1109167312.squirrel@webmail.tuffmail.net>

This is probably better on -performance, and is certainly a FAQ. 
But. . .

On Wed, Feb 23, 2005 at 03:01:52PM +0100, Thomas Braad Toft wrote:
> 
> Table device contains 5285 rows, tmeevent contains 834912 rows.
                        ^^^^                         ^^^^^^

> ->  Seq Scan on tmeevent  (cost=0.00..23606.12 rows=834912 width=138)
> (actual time=0.04..2193.97 rows=834912 loops=1)
                                  ^^^^^^

> ->  Seq Scan on device  (cost=0.00..564.85 rows=5285 width=29) (actual
> time=0.04..25.07 rows=5285 loops=1)
                        ^^^^

> Why isn't the planner using my indexes? I tried making them as both rtree

Because there's no advantage to using an index when you are fetching
100% of both tables.  This is the most efficient plan.  Of course,
it's an open question whether you want to get 100% of both tables. 
But that's what you're doing, and using the index would be more
expoensive than this.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Information security isn't a technological problem.  It's an economics
problem.
		--Bruce Schneier



view thread (3+ messages)  latest in thread

Message-ID: <20050223142526.GA9072@phlogiston.dyndns.org>
Permalink:  ../20050223142526.GA9072@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20050223142526.GA9072@phlogiston.dyndns.org

 · 

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: ajs@crankycanuck.ca
  Subject: Re: PostgreSQL ignores my indexes
  In-Reply-To: <20050223142526.GA9072@phlogiston.dyndns.org>

* 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