Re: Indexes and querys

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Josué Maldonado <josue(at)lamundial(dot)hn>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Indexes and querys
Date: 2003-10-22 21:53:10
Message-ID: Pine.LNX.4.44.0310222352030.8099-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2003-10-22 21:54:49 Re: Prepared Statements
Previous Message Peter Eisentraut 2003-10-22 21:51:03 Re: Adding fields on the fly