forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit69f75bf

Etsuro Fujita
postgres_fdw: Fix assertion in estimate_path_cost_size().
Commit08d2d58 added this assertion assuming that the retrieved_rowsestimate for a foreign relation is set to at least one row inestimate_path_cost_size(), but the assumption isn't correct because ifthe relation is a foreign table with tuples=0, the estimate would be setto 0 in there when using local stats, and if the query's WHERE clausehas a NULL condition, the estimate could be set to 0 in there when usingremote estimates. (Note: even in the latter case the assertion could bereachable when costing foreign final paths.) Repair.Per bug #17713 from Robins Tharakan. This patch was already applied tov13 or later; apply it to v12 as well where the aforementioned commitwas added. Thanks to Richard Guo for investigation.Discussion:http://postgr.es/m/17713-92cce66de7e81c04%40postgresql.orgDiscussion:http://postgr.es/m/CAEP4nAza%2B0fTCLkgkKYux3JDo3tUBTQORehP%2BaCxSNURpSFpHw%40mail.gmail.com1 parent1cca4a7 commit69f75bf
File tree
3 files changed
+31
-1
lines changed- contrib/postgres_fdw
- expected
- sql
3 files changed
+31
-1
lines changedLines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
590 | 590 |
| |
591 | 591 |
| |
592 | 592 |
| |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
593 | 611 |
| |
594 | 612 |
| |
595 | 613 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2749 | 2749 |
| |
2750 | 2750 |
| |
2751 | 2751 |
| |
2752 |
| - | |
| 2752 | + | |
2753 | 2753 |
| |
2754 | 2754 |
| |
2755 | 2755 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
285 | 285 |
| |
286 | 286 |
| |
287 | 287 |
| |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
288 | 300 |
| |
289 | 301 |
| |
290 | 302 |
| |
|
0 commit comments
Comments
(0)