Index not used with user - Mailing list pgsql-general

From gelinas@tech-m4.com
Subject Index not used with user
Date
Msg-id 3C8541DA.88A018CC@tech-m4.com
Whole thread Raw
List 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



pgsql-general by date:

Previous
From: "W. McCloud"
Date:
Subject: Re: Which administration software to use
Next
From: hubert.palme@web.de (Hubert Palme)
Date:
Subject: Re: PL/pgSQL Syntax Problem