Re: BRIN cost estimate
Emre Hasegeli <emre@hasegeli.com>
From: Emre Hasegeli <emre@hasegeli.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2017-03-21T12:39:22Z
Lists: pgsql-hackers
> Not sure what you mean here. I'm not speaking of the brin index am, I > mean the get_index_stats_hook call which you've added. I see. Actually this part was from Alvaro. I haven't noticed the get_index_stats_hook call before, but it is still the same coding as btcostestimate(). btcostestimate() also calls get_index_stats_hook, and then Asserts nnumbers == 1. > hmm, before what exactly? before your patch it didn't exist. You > introduced it into brincostestimate(). I confused by looking at my changes on my repository I made on top of Alvaro's. I will rename it on the next version. > At the very least please write a comment to explain this in the code. > Right now it looks broken. If I noticed this then one day in the > future someone else will. If you write a comment then person of the > future will likely read it, and then not raise any questions about the > otherwise questionable code. Will do. > I do strongly agree that the estimates need improved here. I've > personally had issues with bad brin estimates before, and I'd like to > see it improved. I think the patch is not quite complete without it > also considering stats on expression indexes. If you have time to go > do that I'd suggest you go ahead with that. I will look into it this week.
Commits
-
Fix BRIN cost estimation
- 7e534adcdc70 10.0 landed
-
Make use of statistics on index expressions. There are still some
- a536ed53bca4 8.0.0 cited