Re: More Performance - Mailing list pgsql-hackers

From Matthias Urlichs
Subject Re: More Performance
Date
Msg-id 20000520224043.G11220@noris.de
Whole thread Raw
In response to Re: More Performance  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Hi,

Bruce Momjian:
> > IMHO this is somewhat non-optimal. In the absence of information
> > to the contrary, PostgreSQL should default to using an index if
> > it might be appropriate, not ignore it.
> 
> This is an interesting idea.  So you are saying that if a column has no
> vacuum analyze statistics, assume it is unique?

Nope. But why should vacuum analyze be the one and only part of
PostgreSQL where statistics are ever updated?

When you have no statistics, a "column_name=CONSTANT" query for an
indexed column yields exactly one result (actually, "significantly fewer
results than there are 8-kbyte records in the table" would do), you
might want to record the fact that using the index might, in hindsight,
have been a good idea after all.

Then, when the next query like that comes in, you use the index.

Maybe I'm too naive ;-)  but I fail to see how this approach could
be either hard to implement or detrimental to performance.

-- 
Matthias Urlichs  |  noris network GmbH   |   smurf@noris.de  |  ICQ: 20193661
The quote was selected randomly. Really.       |        http://smurf.noris.de/
-- 
An Army travels on her stomach.


pgsql-hackers by date:

Previous
From: "Matthias Urlichs"
Date:
Subject: Re: More Performance
Next
From: Bruce Momjian
Date:
Subject: Re: More Performance