- Notifications
You must be signed in to change notification settings - Fork5
Commit7706710
committed
Don't make FK-based selectivity estimates in inheritance situations.
The foreign-key-aware logic for estimation of join sizes (added in commit100340e) blindly tried to apply the concept to rels that are actuallyparents of inheritance trees. This is just plain wrong so far as thereferenced relation is concerned, since the inheritance scan may wellproduce lots of rows that are not participating in the constraint. It'swrong for the referencing relation too, for the same reason; although onthat end we could conceivably detect whether all members of the inheritancetree have equivalent FK constraints pointing to the same referenced rel,and then proceed more or less as we do now. But pending somebody writingcode to do that, we must disable this, because it's producing completelysilly estimates when there's an FK linking the heads of inheritance trees.Per bug #14404 from Clinton Adams. Back-patch to 9.6 where the newestimation logic came in.Report: <20161028200412.15987.96482@wrigleys.postgresql.org>1 parentda8f3eb commit7706710
1 file changed
+15
-3
lines changedLines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
| |||
408 | 408 |
| |
409 | 409 |
| |
410 | 410 |
| |
411 |
| - | |
| 411 | + | |
412 | 412 |
| |
413 | 413 |
| |
414 | 414 |
| |
| |||
433 | 433 |
| |
434 | 434 |
| |
435 | 435 |
| |
436 |
| - | |
| 436 | + | |
437 | 437 |
| |
438 | 438 |
| |
439 | 439 |
| |
| |||
448 | 448 |
| |
449 | 449 |
| |
450 | 450 |
| |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
451 | 460 |
| |
452 | 461 |
| |
453 | 462 |
| |
| |||
488 | 497 |
| |
489 | 498 |
| |
490 | 499 |
| |
| 500 | + | |
| 501 | + | |
| 502 | + | |
491 | 503 |
| |
492 | 504 |
| |
493 | 505 |
| |
|
0 commit comments
Comments
(0)