Re: Replace magic numbers with strategy numbers for B-tree indexes
От | Daniil Davydov |
---|---|
Тема | Re: Replace magic numbers with strategy numbers for B-tree indexes |
Дата | |
Msg-id | CAJDiXgh9QuLmkGQKA7sh-=4Aqp9_Opmc74X-Kn8BXcxwQsfX9g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Replace magic numbers with strategy numbers for B-tree indexes (Nikita Malakhov <hukutoc@gmail.com>) |
Ответы |
Re: Replace magic numbers with strategy numbers for B-tree indexes
|
Список | pgsql-hackers |
Hi, On Mon, Sep 1, 2025 at 3:27 PM Nikita Malakhov <hukutoc@gmail.com> wrote: > > Please correct if I'm wrong, but it seems Peter had another approach in mind - > magic numbers in separate macros could be easily replaced with enums and > validation functions, which would make code more readable and less 'magical'. > Please check the POC patch in attach. > I've made this just for BT strategies macros and touched only 2 source files > to make a correct but simple example. > I don't think that we can just create different enums for each index strategies. We have (for example) ScanKey functionality, which can work with different indexes (and such a functions has a uint16 argument for strategy number). Or are you talking about a single huge enum for all index types? I don't mind trying to do something like this, but I'm not sure how "beautiful" it will be. -- Best regards, Daniil Davydov
В списке pgsql-hackers по дате отправления: