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

explain plan

From: rudy <rudy(at)heymax(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: explain plan
Date: 2001-01-30 19:50:48
Message-ID: 3A771B18.A5826279@heymax.com (view raw or flat)
Thread:
Lists: pgsql-novice
Running Red Hat 7.0 kernel 2.2.16
PostgreSQL 7.0.3

skyy=# create unique index article_pkey on article (id_article);
CREATE
skyy=# explain select id_article from article where id_article = 21;
NOTICE:  QUERY PLAN:

Seq Scan on article  (cost=0.00..1.61 rows=1 width=8)

EXPLAIN
skyy=# vacuum analyze article;
VACUUM
skyy=# explain select id_article from article where id_article = 21;
NOTICE:  QUERY PLAN:

Seq Scan on article  (cost=0.00..1.61 rows=1 width=8)

EXPLAIN
skyy=#

This table has 20,000 records. What am I doing wrong? Why doesn't it use
the Index I created? Is there something I need to enable, why wouldn't
it choose an index over a seq scan with more than 20,000 rows to scan?


Thanks In Advance,

Rudy Laczkovich



Responses

pgsql-novice by date

Next:From: Sebastian MiroloDate: 2001-01-31 01:07:09
Subject: Starting postmaster error
Previous:From: Andrew McMillanDate: 2001-01-30 19:20:25
Subject: Re: truncated numeric data

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