Re: Macro customizable hashtable / bitmapscan & aggregation perf

From: Andres Freund <andres(at)anarazel(dot)de>
To: Mark Dilger <hornschnorter(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Macro customizable hashtable / bitmapscan & aggregation perf
Date: 2016-12-09 23:26:47
Message-ID: 20161209232647.rji3yiwcsllhkfgc@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-12-10 01:27:21 Re: proposal: psql statements \gstore \gstore_binary (instead COPY RAW)
Previous Message Mark Dilger 2016-12-09 23:21:36 Re: Macro customizable hashtable / bitmapscan & aggregation perf