Re[2]: [PATCH] Change simple_heap_insert() to a macro

From: Andrey Klychkov <aaklychkov(at)mail(dot)ru>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re[2]: [PATCH] Change simple_heap_insert() to a macro
Date: 2018-10-12 10:09:33
Message-ID: 1539338973.879960702@f45.i.mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> simple_heap_insert() is used in catalog updates and such. Does that have
> any measurable performance impact?

I guess this change doesn't give us an incredible performance increase except there will no redundant function call.
I don't see any reasons against to use the proposed macro instead of this function.

>Пятница, 12 октября 2018, 12:16 +03:00 от Heikki Linnakangas <hlinnaka(at)iki(dot)fi>:
>
>On 12/10/2018 11:54, Andrey Klychkov wrote:
>> Studying another question I noticed a small point for optimization.
>>
>> In the src/backend/access/heap/heapam.c we have the function:
>>
>> - * simple_heap_insert - insert a tuple
>> - *
>> - * Currently, this routine differs from heap_insert only in supplying
>> - * a default command ID and not allowing access to the speedup options.
>> - *
>> - * This should be used rather than using heap_insert directly in most
>> places
>> - * where we are modifying system catalogs.
>> - */
>> -Oid
>> -simple_heap_insert(Relation relation, HeapTuple tup)
>> -{
>> - return heap_insert(relation, tup, GetCurrentCommandId(true), 0, NULL);
>> -}
>>
>> I changed it to a macro. See the attached patch.
>
>simple_heap_insert() is used in catalog updates and such. Does that have
>any measurable performance impact?
>
>- Heikki

--
Regards,
Andrey Klychkov

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Banck 2018-10-12 10:14:48 Re: pgsql: Add TAP tests for pg_verify_checksums
Previous Message Heikki Linnakangas 2018-10-12 09:16:36 Re: [PATCH] Change simple_heap_insert() to a macro