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

Re: How can I make PosgreSQL use an Index ?

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Rhaoni Chiu Pereira <rhaoni(at)sistemica(dot)info>,"pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How can I make PosgreSQL use an Index ?
Date: 2003-09-17 21:54:34
Message-ID: 3F68D81A.2030801@bigfoot.com (view raw or flat)
Thread:
Lists: pgsql-admin
Rhaoni Chiu Pereira wrote:

> Hi list,
> 
>     I have a table like this:
> 
> CREATE TABLE "gsames00" (
>         "ano_mes" varchar(6) NOT NULL,
>         "descricao" varchar(30),
>         PRIMARY KEY ("ano_mes")
> );
> 
> and an index like this:
> 
> CREATE INDEX GSAMES01 ON  GSAMES00 (ANO_MES);
> 
>   When I run a explain analyze with this where clause: 
> 
>    ... gsames00.ano_mes = to_char(ftnfco00.data_emissao,'YYYYMM') AND ...
> 
>    ftnfco00.data_emissao is a timestamp. When I run the explain analyze it says:
> 
> ...
>  ->  Seq Scan on gsames00  (cost=100000000.00..100000006.72 rows=372 width=10) 
> (actual time=0.01..0.96 rows=372 loops=19923)
> ...

looking at the cost I guess that you never run vacuum analyze on your
table, do it and let us know.


Regards
Gaetano Mendola


In response to

pgsql-admin by date

Next:From: Rhaoni Chiu PereiraDate: 2003-09-17 21:54:38
Subject: Re: How can I make PosgreSQL use an Index ?
Previous:From: Dirk LutzebaeckDate: 2003-09-17 21:32:21
Subject: huge pg_toast_<OID>_index files?

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