Re: database not using indexes, yet

From: Szymon Guz <mabewlun(at)gmail(dot)com>
To: Silvio Brandani <silvio(dot)brandani(at)tech(dot)sdb(dot)it>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: database not using indexes, yet
Date: 2011-11-18 14:19:01
Message-ID: CAFjNrYvvBgm=qG2cPjqojhJ_pfAMgTT-q1Abq4-R3X4BAtixRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

2011/11/18 Silvio Brandani <silvio(dot)brandani(at)tech(dot)sdb(dot)it>

> On postgres 8.3.11 on linux centos 5 we have a table not too big with
> primary key index on
>
> Indexes:
> "aida_references_pkey" PRIMARY KEY, btree (aida_reference_id)
>
> the query not use index:
>
> aidadb=# explain analyze select aida_reference_id from
> aida.aida_references where aida_reference_id = '3145';
> QUERY PLAN
> ------------------------------**------------------------------**
> ------------------------------**----------------------
> Seq Scan on aida_references (cost=0.00..51489.15 rows=1 width=4) (actual
> time=0.173..1457.643 rows=1 loops=1)
> Filter: (aida_reference_id = 3145)
> Total runtime: 1457.696 ms
>
>
> already executed the vacuum ,reindex.
>
> Please help
>
> --
> Silvio Brandani
>
>
>
Hi Silvio,
how many rows do you have in the table?
Usually PostgreSQL doesn't want to use index when the table is small.

regards
Szymon

--
*http://simononsoftware.com/* <http://simononsoftware.com/>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Silvio Brandani 2011-11-18 14:41:36 Re: database not using indexes, yet
Previous Message Silvio Brandani 2011-11-18 14:09:42 database not using indexes, yet