Re: [HACKERS] Macro customizable hashtable / bitmapscan &aggregation perf - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] Macro customizable hashtable / bitmapscan &aggregation perf
Date
Msg-id 20161209232647.rji3yiwcsllhkfgc@alap3.anarazel.de
Whole thread Raw
In response to Re: [HACKERS] Macro customizable hashtable / bitmapscan & aggregation perf  (Mark Dilger <hornschnorter@gmail.com>)
List pgsql-hackers
Hi,

On 2016-12-09 15:21:36 -0800, Mark Dilger wrote:
> Andres,
> 
> Your patch, below, appears to have been applied to master in commit
> 5dfc198146b49ce7ecc8a1fc9d5e171fb75f6ba5.  It makes mention of a
> function, tuplehash_start_iterate, in a macro, but the function is not
> defined or declared, and its signature and intention is not clear.  Is there
> any chance you could add some documentation about how this function
> is intended to be used and defined?
> 
> See InitTupleHashIterator in src/include/nodes/execnodes.h

The patch generates functions based on the defined prefix. E.g.

/* define paramters necessary to generate the tuple hash table interface */
#define SH_PREFIX tuplehash
#define SH_ELEMENT_TYPE TupleHashEntryData
#define SH_KEY_TYPE MinimalTuple
#define SH_SCOPE extern
#define SH_DECLARE
#include "lib/simplehash.h"

makes tuplehash_iterate out of
#define SH_START_ITERATE SH_MAKE_NAME(start_iterate)
...
SH_SCOPE void SH_START_ITERATE(SH_TYPE *tb, SH_ITERATOR *iter);
SH_SCOPE void
SH_START_ITERATE(SH_TYPE *tb, SH_ITERATOR *iter)
{
...
}

See the simplehash.h's header for some explanation.


Hope that helps,

Andres



pgsql-hackers by date:

Previous
From: Mark Dilger
Date:
Subject: Re: [HACKERS] Macro customizable hashtable / bitmapscan & aggregation perf
Next
From: Jim Nasby
Date:
Subject: Re: [HACKERS] proposal: psql statements \gstore \gstore_binary(instead COPY RAW)