Re: type cache for concat functions

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: type cache for concat functions
Date: 2017-08-27 07:52:28
Message-ID: CAFj8pRBrUe9mgW2orVywHTCdZa5oRn0VDZrfoS7HhzQX0G8FFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2017-08-24 19:24 GMT+02:00 Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>:

> Hi Pavel,
>
> I tried applying your patch, it applies and compiles fine, check and
> checkworld pass.
>
> I ran a simple performance test, select concat(generate_series(1,100000),
> ... [x5 total]) vs select generate_series(1,100000)::text || ... .
> Operator || runs in 60 ms, while unpatched concat takes 90 and patched --
> 55 ms.
>
> About the code:
> * There seems to be an extra tab here:
> FmgrInfo *typcache;
> It's not aligned with the previous declaration with tab size 4.
>
> * You could allocate the cache and store it into the context inside
> rebuildConcatCache. It would return return the cache pointer, and the
> calling code would look cleaner -- just one line. This is a matter of taste
> though.
>
> * The nearby functions use snake_case, so it should be
> rebuild_concat_cache too.
>

all should be fixed.

Regards

Pavel

>
> Overall the patch looks good to me.
>
> --
> Alexander Kuzmenkov
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company
>
>

Attachment Content-Type Size
faster-concat-2.patch text/x-patch 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2017-08-27 08:12:42 Re: pgbench: Skipping the creating primary keys after initialization
Previous Message Fabien COELHO 2017-08-27 06:37:37 Re: pgbench: faster version of tpcb-like transaction