Re: [HACKERS] Hash support for grouping sets

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Re: [HACKERS] Hash support for grouping sets
Дата
Msg-id 3298DE89-52DD-48EE-A07F-84CC4FD472CA@gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Hash support for grouping sets  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Ответы Re: [HACKERS] Hash support for grouping sets  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
> On Mar 22, 2017, at 8:09 AM, Mark Dilger <hornschnorter@gmail.com> wrote:
>
>
>> On Mar 22, 2017, at 7:55 AM, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>>
>> [snip]
>>
>> This thread seems to have gone quiet - is it time for me to just go
>> ahead and commit the thing anyway? Anyone else want to weigh in?
>
> Sorry for the delay.  I'll try to look at this today.  Others are most welcome
> to weigh in.

You define DiscreteKnapsack to take integer weights and double values,
and perform the usual Dynamic Programming algorithm to solve.  But
the only place you call this, you pass in NULL for the values, indicating
that all the values are equal.  I'm confused why in this degenerate case
you bother with the DP at all.  Can't you just load the knapsack from
lightest to heaviest after sorting, reducing the runtime complexity to O(nlogn)?
It's been a long day.  Sorry if I am missing something obvious.

I'm guessing you intend to extend the code at some later date to have
different values for items.  Is that right?

I reapplied your patch and reran the regression tests on my laptop and they
all pass.

mark




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] segfault in hot standby for hash indexes
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [HACKERS] Logical decoding on standby