Re: WIP: Access method extendability - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: WIP: Access method extendability
Date
Msg-id 20160401124508.41c052c4@fujitsu
Whole thread Raw
In response to Re: WIP: Access method extendability  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: WIP: Access method extendability  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers
Hello, Alexander

> Hi!
> 
> New revision of patches is attached.

Code looks much better now, thanks. Still I believe it could be improved.

I don't think that using srand() / rand() in signValue procedure the
way you did is such a good idea. You create a side affect (changing
current randseed) which could cause problems in some cases. And there
is no real need for that. For instance you could use following formula
instead:

hash(attno || hashVal || j)

And a few more things.

> +     memset(opaque, 0, sizeof(BloomPageOpaqueData));
> +     opaque->maxoff = 0;

This looks a bit redundant.

> + for (my $i = 1; $i <= 10; $i++)

More idiomatic Perl would be `for my $i (1..10)`.

> +             UnlockReleaseBuffer(buffer);
> +             ReleaseBuffer(metaBuffer);
> +             goto away;

In general I don't have anything against goto. But are you sure that
using it here is really justified?

-- 
Best regards,
Aleksander Alekseev
http://eax.me/



pgsql-hackers by date:

Previous
From: "hari.prasath"
Date:
Subject: Logical Decoding - Execute join query
Next
From: Andres Freund
Date:
Subject: Re: Logical Decoding - Execute join query