pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeroen van Iddekinge <iddekingej@lycos.com>
To: pgsql-performance@postgresql.org
Subject: sequence scan on PK
Date: Sun, 08 May 2005 14:59:13 +0000
Message-ID: <427E2941.9070105@lycos.com> (raw)

Hi,


I understand that when a table contains only a few rows it is better to 
do a sequence scan than an index scan. But is this also for a table with 
99 records?

A table contains
id                                          integer (primary key)
name                                    varchar(70)
parent                                   integer
comment                              text
owner                                  integer
inheritAccess                       integer
defaultAccess                      integer
sequence                              bigint
contentsinheritaccessmove   integer
contentsinheritaccessadd      integer


explain select * from tblFolders where id=90;
                        QUERY PLAN
-----------------------------------------------------------
 Seq Scan on tblfolders  (cost=0.00..3.24 rows=1 width=50)
   Filter: (id = 90)


(I have analyze table bit still a sequence scan).

With how manys rows it is  ok to do an index scan or sequence scan? How 
is this calculated in pg?

Regards
 Jer



view thread (10+ messages)  latest in thread

Message-ID: <427E2941.9070105@lycos.com>
Permalink:  ../427E2941.9070105@lycos.com/
Also on:    postgresql.org/message-id/427E2941.9070105@lycos.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: iddekingej@lycos.com
  Subject: Re: sequence scan on PK
  In-Reply-To: <427E2941.9070105@lycos.com>

* 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