Re: mark/restore failures on unsorted merge joins
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-hackers@lists.postgresql.org, kes-kes@yandex.ru
Date: 2020-11-23T19:54:20Z
Lists: pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes: > The problem is that the planner calls ExecSupportsMarkRestore to find > out whether a Materialize node is needed, and that function looks no > further than the Path type of T_Index[Only]Path in order to return true, > even though in this case it's a GiST index which does not support > mark/restore. > (Usually this can't be a problem because the merge join would need > sorted input, thus the index scan would be a btree; but a merge join > that doesn't actually have any sort keys could take unsorted input from > any index type.) Sounds like the right analysis. > Going forward, this looks like IndexOptInfo needs another am* boolean > field, but that's probably not appropriate for the back branches; maybe > as a workaround, ExecSupportsMarkRestore should just check for btree? Uh, why would you not just look to see if the ammarkpos/amrestrpos fields are non-null? regards, tom lane
Commits
-
Properly check index mark/restore in ExecSupportsMarkRestore.
- 660b89928d18 14.0 landed
- 59ed45e278b7 9.5.25 landed
- 6402afd9865e 9.6.21 landed
- 321c87e5ca1a 10.16 landed
- 018e7d98dc15 11.11 landed
- ae5aa26dc39d 12.6 landed
- 6dda057043df 13.2 landed