Index not used with user

From: gelinas(at)tech-m4(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: Index not used with user
Date: 2002-03-05 22:08:26
Message-ID: 3C8541DA.88A018CC@tech-m4.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
i don't understand why my index is not used when i place a constant in
my query.

explain select * from employes2 where usager='postgres';
NOTICE: QUERY PLAN:

Index Scan using employes2_usager on employes2 (cost=0.00..2.01 rows=1
width=222)

EXPLAIN
explain select * from employes2 where usager=user;
NOTICE: QUERY PLAN:

Seq Scan on employes2 (cost=0.00..2.81 rows=1 width=222)

EXPLAIN

Can you help me?

--
Steve Gelinas
System administrator

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Lockhart 2002-03-05 22:58:57 Python client code (was, Mandrake RPMs uploaded)
Previous Message Hubert Palme 2002-03-05 20:33:44 Re: PL/pgSQL Syntax Problem