Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls
От | Nicholas White |
---|---|
Тема | Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls |
Дата | |
Msg-id | CA+=vxNZPKG65vsEWcv1dOKgRsRj5m2ZfjufBmwJEY9ow8Vnw0Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls (Robert Haas <robertmhaas@gmail.com>) |
Список | pgsql-hackers |
I've fixed the problems you mentioned (see attached) - sorry, I was a bit careless with the docs.
> + null_values = (Bitmapset *) WinGetPartitionLocalMemory(
> + winobj,
> + BITMAPSET_SIZE(words_needed));
> + Assert(null_values);
>
> This certainly seems ugly - isn't there a way to accomplish this
> without having to violate the Bitmapset abstraction?
Indeed, it's ugly. I've revised it slightly to: > + null_values = (Bitmapset *) WinGetPartitionLocalMemory(
> + winobj,
> + BITMAPSET_SIZE(words_needed));
> + Assert(null_values);
>
> This certainly seems ugly - isn't there a way to accomplish this
> without having to violate the Bitmapset abstraction?
> null_values = (Bitmapset *) WinGetPartitionLocalMemory(
> winobj,
> BITMAPSET_SIZE(words_needed));
> null_values->nwords = (int) words_needed;
I don't think the solution would be tidier if I re-instated the leadlag_context struct with a single Bitmapset member. Other Bitmapset usage seems to just call bms_make_singleton then bms_add_member over and over again - which afaict will call palloc every BITS_PER_BITMAPWORD calls, which is not really what I want.
Вложения
В списке pgsql-hackers по дате отправления: