Re: why Sequencial Scan when selecting on primary key of table?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Brian Tarbox" <btarbox(at)theworld(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: why Sequencial Scan when selecting on primary key of table?
Date: 2003-05-31 17:55:01
Message-ID: 21289.1054403701@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Brian Tarbox" <btarbox(at)theworld(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Sullivan 2003-05-31 18:02:35 Re: why Sequencial Scan when selecting on primary key of table?
Previous Message Rod Taylor 2003-05-31 17:51:11 Re: why Sequencial Scan when selecting on primary key of table?