Re: track_planning causing performance regression

From: Hamid Akhtar <hamid(dot)akhtar(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: track_planning causing performance regression
Date: 2020-08-19 12:45:41
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: not tested
Spec compliant: not tested
Documentation: not tested

Overall, the patch works fine. However, I have a few observations:

(1) Code Comments:
- The code comments should be added for the 2 new macros, in particular for PGSS_NUM_LOCK_PARTITIONS. As you explained in your email, this may be used to limit the number of locks if a very large value for pgss_max is specified.
- From the code I inferred that the number of locks can in future be less than pgss_max (per your email where in future this macro could be used to limit the number of locks). I suggest to perhaps add some notes helping future changes in this code area.

(2) It seems like that "pgss->lock = &(pgss->base + pgss_max)->lock;" statement should not use pgss_max directly and instead use PGSS_NUM_LOCK_PARTITIONS macro, as when a limit is imposed on number of locks, this statement will cause an overrun.

Highgo Software (Canada/China/Pakistan)
ADDR: 10318 WHALLEY BLVD, Surrey, BC
CELL:+923335449950  EMAIL: mailto:hamid(dot)akhtar(at)highgo(dot)ca
SKYPE: engineeredvirus

The new status of this patch is: Waiting on Author

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2020-08-19 12:50:16 Refactor pg_rewind code and make it work against a standby
Previous Message Fujii Masao 2020-08-19 12:41:03 Re: SyncRepLock acquired exclusively in default configuration