Skip site navigation (1) Skip section navigation (2)

Re: slow select

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Medora Schauer" <mschauer(at)fairfield(dot)com>,"postgresql" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: slow select
Date: 2003-10-22 16:23:15
Message-ID: 200310220923.15932.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-performance
Medora,

> I'm using pg 7.3.4 to do a select involving a join on 2 tables.
> The query is taking 15 secs which seems extreme to me considering
> the indices that exist on the two tables.  EXPLAIN ANALYZE shows
> that the indices aren't being used.  I've done VACUUM ANALYZE on the
> db with no change in results.  Shouldn't the indices be used?

No.  You're selecting 100,000 records.   For such a large record dump, a seq 
scan is usually faster.

If you don't believe me, try setting enable_seqscan=false and see how long the 
query takes.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

  • slow select at 2003-10-22 14:48:19 from Medora Schauer

pgsql-performance by date

Next:From: Josh BerkusDate: 2003-10-22 16:27:49
Subject: Re: Low Insert/Update Performance
Previous:From: Rhaoni Chiu PereiraDate: 2003-10-22 16:21:37
Subject: Re: [PERFORM] Low Insert/Update Performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group