Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect) - Mailing list pgsql-hackers

From Zeugswetter Andreas IZ5
Subject Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
Date
Msg-id 219F68D65015D011A8E000006F8590C60339E093@sdexcsrv1.f000.d0188.sd.spardat.at
Whole thread Raw
Responses Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
List pgsql-hackers
> So, the selectivity that a search for the most common value would
> have is a reasonable estimate for the selectivity of a search for any
> value.  That's a bogus assumption in this case --- but it's hard to
> justify making any other assumption in general.
> 
Other db's usually use the value count(*) / nunique for the light weight
statistics.
This makes the assumptoin that the distinct index values are evenly
distributed.
That is on average a correct assumption, whereas our assumption on average
overestimates the number of rows returned.
I am not sure we have a nunique info though.

Andreas



pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: double opens
Next
From: Zeugswetter Andreas IZ5
Date:
Subject: Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)