RE: ResourceOwner refactoring

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>
To: 'Heikki Linnakangas' <hlinnaka@iki.fi>, Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-01-21T02:22:20Z
Lists: pgsql-hackers
Dear Heikki,

I tested in the same situation, and I confirmed that almost same results are returned.
(results are at the end of the e-mail)

You think that these results are acceptable
because resowners own many resources(more than 64) in general
and it's mainly faster in such a situation, isn't it?

I cannot distinguish correctly, but sounds good.

====test result====

unpatched

 numkeep | numsnaps | lifo_time_ns | fifo_time_ns 
---------+----------+--------------+--------------
       0 |        1 |         68.5 |         69.9
       0 |        5 |         73.2 |         76.8
       0 |       10 |         70.6 |         74.7
       0 |       60 |         68.0 |         75.6
       0 |       70 |         91.3 |         94.8
       0 |      100 |         89.0 |         89.1
       0 |     1000 |         97.9 |         98.9
       0 |    10000 |        116.0 |        115.9
       9 |       10 |         74.7 |         76.6
       9 |      100 |         80.8 |         80.1
       9 |     1000 |         86.0 |         86.2
       9 |    10000 |        116.1 |        116.8
      65 |       70 |         84.7 |         85.3
      65 |      100 |         80.5 |         80.3
      65 |     1000 |         86.3 |         86.2
      65 |    10000 |        115.4 |        115.9
(16 rows)

patched

 numkeep | numsnaps | lifo_time_ns | fifo_time_ns 
---------+----------+--------------+--------------
       0 |        1 |         62.4 |         62.6
       0 |        5 |         68.0 |         66.9
       0 |       10 |         73.6 |         78.1
       0 |       60 |         82.3 |         87.2
       0 |       70 |         83.0 |         89.1
       0 |      100 |         82.8 |         87.9
       0 |     1000 |         88.2 |         96.6
       0 |    10000 |        119.6 |        124.5
       9 |       10 |         62.0 |         62.8
       9 |      100 |         75.3 |         78.0
       9 |     1000 |         82.6 |         89.3
       9 |    10000 |        116.6 |        122.6
      65 |       70 |         66.7 |         66.4
      65 |      100 |         74.6 |         77.2
      65 |     1000 |         82.1 |         88.2
      65 |    10000 |        118.0 |        124.1
(16 rows)

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

Commits

  1. Make RelationFlushRelation() work without ResourceOwner during abort

  2. Fix bug in bulk extending temp relation after failure

  3. Add missing PGDLLIMPORT markings

  4. Add test_dsa module.

  5. Clear CurrentResourceOwner earlier in CommitTransaction.

  6. Fix dsa.c with different resource owners.

  7. Fix bug in the new ResourceOwner implementation.

  8. Change pgcrypto to use the new ResourceOwner mechanism.

  9. Use a faster hash function in resource owners.

  10. Make ResourceOwners more easily extensible.

  11. Move a few ResourceOwnerEnlarge() calls for safety and clarity.