From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brian Tarbox <btarbox@theworld.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: why Sequencial Scan when selecting on primary key of table?
Date: Sat, 31 May 2003 13:55:01 -0400
Message-ID: <21289.1054403701@sss.pgh.pa.us> (raw)
In-Reply-To: <000001c3279c$79dc2d80$01000001@trouble>
References: <000001c3279c$79dc2d80$01000001@trouble>
"Brian Tarbox" <btarbox@theworld.com> writes:
> The primary key field is an integer and I have performed vacuum analyse but
> that does not seem to change anything.
Hm. So how big is the table, exactly? On small tables a seqscan will
be preferred because the extra I/O to examine the index costs more than
the CPU to examine all the tuples on a disk page.
> I've also heard that postgres will not indexes when JOINing tables. Can
> that really be true??
We have some join methods that like indexes and we have some that find
no benefit in 'em. Again, testing on toy-size tables is not a good
guide to what will happen on larger tables.
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-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, btarbox@theworld.com
Subject: Re: why Sequencial Scan when selecting on primary key of table?
In-Reply-To: <21289.1054403701@sss.pgh.pa.us>
References: <000001c3279c$79dc2d80$01000001@trouble> <21289.1054403701@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