Fwd: Add red-black tree missing comparison searches
От | Steve Chavez |
---|---|
Тема | Fwd: Add red-black tree missing comparison searches |
Дата | |
Msg-id | CAGRrpzaeKaLiVu9HEdxFn4F1LQVdQkZPcHXham0o4ct+yuYDPg@mail.gmail.com обсуждение исходный текст |
Ответ на | Add red-black tree missing comparison searches (Steve Chavez <steve@supabase.io>) |
Ответы |
Re: Add red-black tree missing comparison searches
|
Список | pgsql-hackers |
---------- Forwarded message ---------
From: Steve Chavez <steve@supabase.io>
Date: Wed, 6 Jul 2022 at 18:14
Subject: Re: Add red-black tree missing comparison searches
To: Alexander Korotkov <aekorotkov@gmail.com>
From: Steve Chavez <steve@supabase.io>
Date: Wed, 6 Jul 2022 at 18:14
Subject: Re: Add red-black tree missing comparison searches
To: Alexander Korotkov <aekorotkov@gmail.com>
Thanks Alexander!
wrt to the new patch. I think the following comment is misleading since keyDeleted can be true or false:
+ /* switch equal_match to false so we only find greater matches now */
+ node = (IntRBTreeNode *) rbt_find_great(tree, (RBTNode *) &searchNode,
+ keyDeleted);
+ /* switch equal_match to false so we only find greater matches now */
+ node = (IntRBTreeNode *) rbt_find_great(tree, (RBTNode *) &searchNode,
+ keyDeleted);
Maybe it should be the same used for searching lesser keys:
+ /*
+ * Find the next key. If the current key is deleted, we can pass
+ * equal_match == true and still find the next one.
+ */
+ * Find the next key. If the current key is deleted, we can pass
+ * equal_match == true and still find the next one.
+ */
On Wed, 6 Jul 2022 at 13:53, Alexander Korotkov <aekorotkov@gmail.com> wrote:
Hi, Steve!
On Sat, Jul 2, 2022 at 10:38 PM Steve Chavez <steve@supabase.io> wrote:
> > But I think we can support strict inequalities too (e.g.
> less and greater without equals). Could you please make it a bool
> argument equal_matches?
>
> Sure, an argument is a good idea to keep the code shorter.
>
> > Could you please extract this change as a separate patch.
>
> Done!
Thank you!
I did some improvements to the test suite, run pgindent and wrote
commit messages.
I think this is quite straightforward and low-risk patch. I'm going
to push it if no objections.
------
Regards,
Alexander Korotkov
В списке pgsql-hackers по дате отправления: