Re: [SQL] [PERFORM] 7.3.1 index use / performance

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Pgsql Performance <pgsql-performance(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] [PERFORM] 7.3.1 index use / performance
Date: 2003-01-08 17:53:54
Message-ID: Pine.LNX.4.44.0301081547150.14415-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance pgsql-sql

On Tue, 7 Jan 2003, Tom Lane wrote:

> Rod Taylor <rbt(at)rbt(dot)ca> writes:
> >> I am wondering about a compiler bug, or some other peculiarity on your
> >> platform. Can anyone else using FreeBSD try the above experiment and
> >> see if they get different results from mine on 7.3.* (or CVS tip)?
>
> > On FreeBSD 4.7 I received the exact same results as Tom using the
> > statements shown by Tom.
>
> On looking at the code, I do see part of a possible mechanism for this
> behavior: cost_index calculates the estimated cost for qual-clause
> evaluation like this:
>

This bizarre index decreased cost (when adding conditions) behaviour maybe
was due to some vacuums.
(i cant remember how many reloads and vacuums i did to the database
in the period petween the two emails).

However my linux machine with the same pgsql 7.3.1, with a full clean
installation also gives the same symptoms:
Choosing the slow index, and after some (random)
vacuums choosing the right index, and then after some vacuums chooses the
bad
index again.

>
> regards, tom lane
>

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-10-8981112
fax: +30-10-8981877
email: achill(at)matrix(dot)gatewaynet(dot)com
mantzios(at)softlab(dot)ece(dot)ntua(dot)gr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2003-01-08 17:54:10 Re: [HACKERS] Have people taken a look at pgdiff yet?
Previous Message Tom Lane 2003-01-08 17:52:28 Re: tracking down breakins?

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2003-01-08 19:08:13 Re: postgresql in cluster of servers
Previous Message Tom Lane 2003-01-08 17:32:33 Re: [SQL] [PERFORM] 7.3.1 index use / performance

Browse pgsql-sql by date

  From Date Subject
Next Message Ron Peterson 2003-01-08 18:13:03 Re: insert rule doesn't see id field
Previous Message Josh Berkus 2003-01-08 17:44:19 Re: count(*) optimization