Re: why Sequencial Scan when selecting on primary key of table? - Mailing list pgsql-performance

From Tom Lane
Subject Re: why Sequencial Scan when selecting on primary key of table?
Date
Msg-id 21289.1054403701@sss.pgh.pa.us
Whole thread Raw
In response to Re: why Sequencial Scan when selecting on primary key of table?  ("Brian Tarbox" <btarbox@theworld.com>)
List pgsql-performance
"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

pgsql-performance by date:

Previous
From: Rod Taylor
Date:
Subject: Re: why Sequencial Scan when selecting on primary key of table?
Next
From: Andrew Sullivan
Date:
Subject: Re: why Sequencial Scan when selecting on primary key of table?