forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit281f401
committed
Fix some planner bugs exposed by reports from Arjen van der Meijden. These
are all in new-in-8.2 logic associated with indexability of ScalarArrayOpExpr(IN-clauses) or amortization of indexscan costs across repeated indexscanson the inside of a nestloop. In particular:Fix some logic errors in the estimation for multiple scans induced by aScalarArrayOpExpr indexqual.Include a small cost component in bitmap index scans to reflect the costs ofmanipulating the bitmap itself; this is mainly to prevent a bitmap scan fromappearing to have the same cost as a plain indexscan for fetching a singletuple.Also add a per-index-scan-startup CPU cost component; while prior releaseswere clearly too pessimistic about the cost of repeated indexscans, theoriginal 8.2 coding allowed the cost of an indexscan to effectively go to zeroif repeated often enough, which is overly optimistic.Pay some attention to index correlation when estimating costs for a nestloopinner indexscan: this is significant when the plan fetches multiple heaptuples per iteration, since high correlation means those tuples are probablyon the same or adjacent heap pages.1 parent782d68e commit281f401
2 files changed
+87
-23
lines changedLines changed: 40 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
57 |
| - | |
| 57 | + | |
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
| |||
276 | 276 |
| |
277 | 277 |
| |
278 | 278 |
| |
279 |
| - | |
| 279 | + | |
| 280 | + | |
280 | 281 |
| |
281 |
| - | |
| 282 | + | |
282 | 283 |
| |
283 |
| - | |
284 |
| - | |
285 |
| - | |
| 284 | + | |
286 | 285 |
| |
287 | 286 |
| |
288 | 287 |
| |
| |||
291 | 290 |
| |
292 | 291 |
| |
293 | 292 |
| |
294 |
| - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
295 | 314 |
| |
296 | 315 |
| |
297 | 316 |
| |
| |||
312 | 331 |
| |
313 | 332 |
| |
314 | 333 |
| |
| 334 | + | |
315 | 335 |
| |
316 |
| - | |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
321 | 341 |
| |
322 |
| - | |
323 |
| - | |
| 342 | + | |
324 | 343 |
| |
325 | 344 |
| |
326 | 345 |
| |
| |||
614 | 633 |
| |
615 | 634 |
| |
616 | 635 |
| |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
617 | 643 |
| |
618 | 644 |
| |
619 | 645 |
| |
|
Lines changed: 47 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
4673 | 4673 |
| |
4674 | 4674 |
| |
4675 | 4675 |
| |
| 4676 | + | |
4676 | 4677 |
| |
4677 | 4678 |
| |
4678 |
| - | |
4679 |
| - | |
4680 |
| - | |
4681 |
| - | |
4682 |
| - | |
4683 |
| - | |
| 4679 | + | |
| 4680 | + | |
| 4681 | + | |
| 4682 | + | |
| 4683 | + | |
| 4684 | + | |
| 4685 | + | |
| 4686 | + | |
| 4687 | + | |
4684 | 4688 |
| |
4685 | 4689 |
| |
4686 | 4690 |
| |
| |||
4786 | 4790 |
| |
4787 | 4791 |
| |
4788 | 4792 |
| |
4789 |
| - | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
4790 | 4796 |
| |
4791 | 4797 |
| |
4792 | 4798 |
| |
| |||
4801 | 4807 |
| |
4802 | 4808 |
| |
4803 | 4809 |
| |
4804 |
| - | |
| 4810 | + | |
| 4811 | + | |
| 4812 | + | |
| 4813 | + | |
| 4814 | + | |
| 4815 | + | |
| 4816 | + | |
| 4817 | + | |
| 4818 | + | |
| 4819 | + | |
| 4820 | + | |
| 4821 | + | |
| 4822 | + | |
| 4823 | + | |
| 4824 | + | |
| 4825 | + | |
4805 | 4826 |
| |
4806 | 4827 |
| |
4807 | 4828 |
| |
| |||
4829 | 4850 |
| |
4830 | 4851 |
| |
4831 | 4852 |
| |
| 4853 | + | |
4832 | 4854 |
| |
4833 | 4855 |
| |
4834 | 4856 |
| |
| |||
4852 | 4874 |
| |
4853 | 4875 |
| |
4854 | 4876 |
| |
| 4877 | + | |
4855 | 4878 |
| |
4856 | 4879 |
| |
4857 | 4880 |
| |
| |||
4928 | 4951 |
| |
4929 | 4952 |
| |
4930 | 4953 |
| |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
4931 | 4963 |
| |
4932 | 4964 |
| |
4933 | 4965 |
| |
| |||
4949 | 4981 |
| |
4950 | 4982 |
| |
4951 | 4983 |
| |
| 4984 | + | |
| 4985 | + | |
| 4986 | + | |
| 4987 | + | |
| 4988 | + | |
| 4989 | + | |
4952 | 4990 |
| |
4953 | 4991 |
| |
4954 | 4992 |
| |
|
0 commit comments
Comments
(0)