Re: Index scan ???

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Tourtounis Sotiris <tourtoun(at)csd(dot)uoc(dot)gr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Index scan ???
Date: 2002-08-04 05:25:37
Message-ID: Pine.LNX.4.44.0208040120530.29827-100000@cm-lcon1-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tourtounis Sotiris dijo:

> The first attribute is classified in descending order and there are
> indexes on it and to the third atribute respectively. I make some SQL
> questions on them in order to use the created b-trees on the first
> attribute and for 3-4 times there isan index scan on it as it used to
> be. However, after those 3-4 times the database start to use
> sequential scan on this first index.

I don't really believe the query plan simply changes without something
else changing (query or data). Note that different queries _will_ have
different plans: ones will use index, others will not. Also, concurrent
updates may be altering what you are seeing. See the FAQ about indexes
not being used.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"Find a bug in a program, and fix it, and the program will work today.
Show the program how to find and fix a bug, and the program
will work forever" (Oliver Silfridge)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2002-08-04 05:31:47 Re: CVS problem
Previous Message Alvaro Herrera 2002-08-04 05:19:52 Re: how to get primary / unique key on table ?