Commit 5843659
committed
Stabilize test case added by commit f61db90.
Buildfarm members ayu and tern have sometimes shown a different
plan than expected for this query. I'd been unable to reproduce
that before today, but I finally realized what is happening.
If there is a concurrent open transaction (probably an autovacuum
run in the buildfarm, but this can also be arranged manually),
then the index entries for the rows removed by the DELETE a few
lines up are not killed promptly, causing a change in the planner's
estimate of the extremal value of ft2.c1, which moves the rowcount
estimate for "c1 > 1100" by enough to change the join plan from
nestloop to hash.
To fix, change the query condition to "c1 > 1000", causing the
hash plan to be preferred whether or not a concurrent open
transaction exists. Since this UPDATE is tailored to be a no-op,
nothing else changes.
Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=ayu&dt=2021-06-09%2022%3A45%3A48
Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=ayu&dt=2021-06-13%2022%3A38%3A18
Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=tern&dt=2021-06-20%2004%3A55%3A361 parent 6991e77 commit 5843659
File tree
2 files changed
+13
-10
lines changed- contrib/postgres_fdw
- expected
- sql
2 files changed
+13
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5535 | 5535 | | |
5536 | 5536 | | |
5537 | 5537 | | |
5538 | | - | |
| 5538 | + | |
5539 | 5539 | | |
5540 | 5540 | | |
5541 | 5541 | | |
5542 | 5542 | | |
5543 | 5543 | | |
5544 | 5544 | | |
5545 | 5545 | | |
5546 | | - | |
5547 | | - | |
| 5546 | + | |
| 5547 | + | |
5548 | 5548 | | |
| 5549 | + | |
5549 | 5550 | | |
5550 | 5551 | | |
5551 | | - | |
5552 | | - | |
| 5552 | + | |
| 5553 | + | |
5553 | 5554 | | |
5554 | | - | |
5555 | | - | |
| 5555 | + | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
5556 | 5559 | | |
5557 | 5560 | | |
5558 | | - | |
| 5561 | + | |
5559 | 5562 | | |
5560 | 5563 | | |
5561 | 5564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | | - | |
| 1262 | + | |
1263 | 1263 | | |
1264 | | - | |
| 1264 | + | |
1265 | 1265 | | |
1266 | 1266 | | |
1267 | 1267 | | |
| |||
0 commit comments