Re: tuple radix sort - Mailing list pgsql-hackers

From cca5507
Subject Re: tuple radix sort
Date
Msg-id tencent_49E3F11E74D8A584A2144ED532A490CBC40A@qq.com
Whole thread Raw
In response to Re: tuple radix sort  (John Naylor <johncnaylorls@gmail.com>)
List pgsql-hackers
Hi John,

How about adding an assertion here:

```
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 72c2c2995d8..bcc534136d7 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -2783,6 +2783,8 @@ radix_sort_recursive(SortTuple *begin, size_t n_elems, int level, Tuplesortstate
        else
                next_level = level + 1;

+       Assert(next_level > level);
+
        for (uint8 *rp = remaining_partitions;
                 rp < remaining_partitions + num_partitions;
                 rp++)
```

It can help us catch some unexpected behaviors.

--
Regards,
ChangAo Chen

pgsql-hackers by date:

Previous
From: Adam Lee
Date:
Subject: [PATCH] Fix minRecoveryPoint not advanced past checkpoint in CreateRestartPoint
Next
From: Zsolt Parragi
Date:
Subject: Re: [oauth] Split and extend PGOAUTHDEBUG