Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group