Re: Indexes and querys - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Indexes and querys
Date
Msg-id Pine.LNX.4.44.0310222352030.8099-100000@peter.localdomain
Whole thread Raw
In response to Indexes and querys  (Josué Maldonado <josue@lamundial.hn>)
List pgsql-general
Josué Maldonado writes:

> I have a table with an index in a foreing key field (int4), if I do
> select from pedido where prvdfk=3, explain says is using seq scan to
> access it. I noticed all my querys runs in that way, except in the
> querys where the PK field (unique type index) is included in the where
> clause.

PostgreSQL will choose to use an index when it thinks it will be faster,
but this is not always the case.  If you want to learn more about how
indexes work or how to evaluate query performance, please read the
documentation.

--
Peter Eisentraut   peter_e@gmx.net


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Adding fields on the fly
Next
From: Peter Eisentraut
Date:
Subject: Re: Prepared Statements