From: Josh Berkus <josh@agliodbs.com>
To: Medora Schauer <mschauer@fairfield.com>
To: postgresql <pgsql-performance@postgresql.org>
Subject: Re: slow select
Date: Wed, 22 Oct 2003 09:23:15 -0700
Message-ID: <200310220923.15932.josh@agliodbs.com> (raw)
In-Reply-To: <906E2C446A276048A1BE283F17BCB12CDB40E6@encounter.fairind.fairfield.com>
References: <906E2C446A276048A1BE283F17BCB12CDB40E6@encounter.fairind.fairfield.com>
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: josh@agliodbs.com, mschauer@fairfield.com
Subject: Re: slow select
In-Reply-To: <200310220923.15932.josh@agliodbs.com>
References: <906E2C446A276048A1BE283F17BCB12CDB40E6@encounter.fairind.fairfield.com> <200310220923.15932.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