forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1db5af2
committed
Fix gincostestimate to handle ScalarArrayOpExpr reasonably.
The original coding of this function overlooked the possibility thatit could be passed anything except simple OpExpr indexquals. ButScalarArrayOpExpr is possible too, and the code would probably crash(and surely give ridiculous answers) in such a case. Add logic to tryto estimate sanely for such cases.In passing, fix the treatment of inner-indexscan cost estimation: it wasfailing to scale up properly for multiple iterations of a nestloop.(I think somebody might've thought that index_pages_fetched() is linear,but of course it's not.)Report, diagnosis, and preliminary patch by Marti Raudsepp; I refactoredit a bit and fixed the cost estimation.Back-patch into 9.1 where the bogus code was introduced.1 parentd0024cd commit1db5af2
File tree
3 files changed
+366
-144
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+366
-144
lines changed0 commit comments
Comments
(0)