PrepareTempTablespaces directly before making temp file
PrepareTempTablespaces is called by almost all callers of
BufFileCreateTemp* and seems like it would be easier from a readability
perspective and as a developer when writing some code that is going to
make temp files, I would prefer not to have to remember to check and set
the value that the user set for temp tablespaces GUC. It seems like that
is an unnecessary chore that is easily forgotten.
For example, for HashAgg, we have our own spilling implementation and
forgot to call PrepareTempTablespaces, so spill files were not getting
created in the temp tablespace specified by the user.
Note that in the workfile_mgr_test, we use SetConfigOption to set the
temp_tablespaces GUC. It would also have worked to redeclare the
variable in the test file and then assign to it. However, SetConfigOption
is used when a user sets a GUC, so it seems more intuitive for the
reader of the test to use this.
Co-authored-by: NAshwin Agrawal <aagrawal@pivotal.io>
Showing
想要评论请 注册 或 登录