From: Tom Lane <tgl@sss.pgh.pa.us>
To: Emils Klotins <emils@grafton.lv>
Cc: pgsql-sql@hub.org
Subject: Re: Q: performance on some selects (7.0.2)?
Date: Wed, 04 Oct 2000 11:22:11 -0400
Message-ID: <3295.970672931@sss.pgh.pa.us> (raw)
In-Reply-To: <39DB1CFB.10000.5BA3CB0@localhost>
References: <39DB1CFB.10000.5BA3CB0@localhost>
"Emils Klotins" <emils@grafton.lv> writes:
> Sort (cost=171.93..171.93 rows=1 width=56)
> -> Nested Loop (cost=0.00..171.92 rows=1 width=56)
> -> Nested Loop (cost=0.00..169.95 rows=1 width=36)
> -> Seq Scan on articles_groups x (cost=0.00..12.10
> rows=1 width=4)
> -> Seq Scan on articles a (cost=0.00..135.55 rows=636
> width=32)
> -> Seq Scan on newscategories c (cost=0.00..1.43 rows=43
> width=20)
Given the small estimated costs and row counts, I wonder whether you've
ever vacuumed articles_groups and newscategories. The plan is not too
unreasonable if the planner is right about how many rows will be matched
in each of those tables --- but if you've never done a vacuum then the
planner has no accurate stats to work with, so its guesses are likely
way off.
The plan is clearly handicapped by the lack of indexes on article.id
and articles_groups.groupid, also. You seem to have indexes on all
the wrong columns of articles :-( ... each of those indexes costs you
on updates, but will it ever be useful in a query?
regards, tom lane
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-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, emils@grafton.lv, pgsql-sql@hub.org
Subject: Re: Q: performance on some selects (7.0.2)?
In-Reply-To: <3295.970672931@sss.pgh.pa.us>
References: <39DB1CFB.10000.5BA3CB0@localhost> <3295.970672931@sss.pgh.pa.us>
* 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