Re: get_actual_variable_range vs idx_scan/idx_tup_fetch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
Date
Msg-id 30920.1413602168@sss.pgh.pa.us
Whole thread Raw
In response to Re: get_actual_variable_range vs idx_scan/idx_tup_fetch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
List pgsql-hackers
I wrote:
> Because it needs up-to-date min/max values in order to avoid being
> seriously misled about selectivities of values near the endpoints.
> See commit 40608e7f949fb7e4025c0ddd5be01939adc79eec.

BTW, on re-reading that code I notice that it will happily seize upon
the first suitable index ("first" in OID order), regardless of how many
lower-order columns that index has got.  This doesn't make any difference
I think for get_actual_variable_range's own purposes, because it's only
expecting to touch the endmost index page regardless.  However, in light
of Marko's complaint maybe we should teach it to check all the indexes
and prefer the matching one with fewest columns?  It would only take a
couple extra lines of code, and probably not that many added cycles
considering we're going to do an index access of some sort.  But I'm
not sure if it's worth any extra effort --- I think in his example
case, there wasn't any narrower index anyway.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: get_actual_variable_range vs idx_scan/idx_tup_fetch
Next
From: David Gould
Date:
Subject: Re: Vitesse DB call for testing