Hi Richard, Sorry for not responding for a long time, I missed the previous email by accident :-)
I attached a newer patch based on your suggestions and created an entry in cf manager. https://commitfest.postgresql.org/40/3924/ Best Regards, Xing Guo On 9/16/22, Richard Guo <guofengli...@gmail.com> wrote: > On Wed, Jul 27, 2022 at 5:10 PM Xing Guo <higuox...@gmail.com> wrote: > >> The bounded heap sorting status flag is set twice in sort_bounded_heap() >> and tuplesort_performsort(). This patch helps remove one of them. >> > > Revisiting this patch I think maybe it's better to remove the setting of > Tuplesort status from tuplesort_performsort() for the TSS_BOUNDED case. > Thus we keep the heap manipulation routines, make_bounded_heap and > sort_bounded_heap, consistent in that they update their status > accordingly inside the function. > > Also, would you please add it to the CF to not lose track of it? > > Thanks > Richard > -- Best Regards, Xing
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c index 416f02ba3c..ef85e58aeb 100644 --- a/src/backend/utils/sort/tuplesort.c +++ b/src/backend/utils/sort/tuplesort.c @@ -1445,7 +1445,6 @@ tuplesort_performsort(Tuplesortstate *state) state->eof_reached = false; state->markpos_offset = 0; state->markpos_eof = false; - state->status = TSS_SORTEDINMEM; break; case TSS_BUILDRUNS: