Re: Is Optimizer smart enough? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is Optimizer smart enough?
Date
Msg-id 8514.1136956125@sss.pgh.pa.us
Whole thread Raw
In response to Is Optimizer smart enough?  (tmorelli@tmorelli.com.br)
List pgsql-hackers
tmorelli@tmorelli.com.br writes:
> Just for curiosity: suppose there is an excellent index frequently picked by
> the optimizer. Suppose now that this index became extremelly fragmented with
> thousands of updates. Without a REINDEX, will Optimizer still pick it? Or the
> optimizer is smart enough to detect index fragmentation and discard it?

IIRC, btcostestimate is sensitive to the physical size of the index,
so it would catch the first-order effect of index bloat.  It wouldn't
notice index fragmentation in the sense of increasingly random location
of logically-sequential leaf pages.  But I'm not sure how much that
matters for typical situations.  If you have a huge fraction of dead
tuples, I'd say that index fragmentation is not your worst problem...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tony Caduto
Date:
Subject: Re: Question about Postgresql time fields(possible bug)
Next
From: Neil Conway
Date:
Subject: leaks in TopMemoryContext?