[pgpool-hackers: 4149] Excessive calculation in pool_coninfo_backend_pid()

Tatsuo Ishii ishii at sraoss.co.jp
Mon Apr 11 10:05:00 JST 2022


The function calls pool_get_process_info() for num_init_children
times. Moreover, pool_get_process_info() may iterate accessing process
info for num_init_children times. As a result,
pool_coninfo_backend_pid() may access the process info structure for
num_init_children * num_init_children times. For example if
num_init_children = 1000, then the iteration will be 1000*1000 = 1
million times.

We could enhance this by inventing new API for accessing the process
info array by using subscript of the array instead of
pool_get_process_info().

Best reagards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list