mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add GUC and storage parameter to set the maximum size of GIN pending list.
Previously the maximum size of GIN pending list was controlled only by work_mem. But the reasonable value of work_mem and the reasonable size of the list are basically not the same, so it was not appropriate to control both of them by only one GUC, i.e., work_mem. This commit separates new GUC, pending_list_cleanup_size, from work_mem to allow users to control only the size of the list. Also this commit adds pending_list_cleanup_size as new storage parameter to allow users to specify the size of the list per index. This is useful, for example, when users want to increase the size of the list only for the GIN index which can be updated heavily, and decrease it otherwise. Reviewed by Etsuro Fujita.
This commit is contained in:
@ -96,14 +96,6 @@
|
||||
#define CONFIG_EXEC_PARAMS_NEW "global/config_exec_params.new"
|
||||
#endif
|
||||
|
||||
/* upper limit for GUC variables measured in kilobytes of memory */
|
||||
/* note that various places assume the byte size fits in a "long" variable */
|
||||
#if SIZEOF_SIZE_T > 4 && SIZEOF_LONG > 4
|
||||
#define MAX_KILOBYTES INT_MAX
|
||||
#else
|
||||
#define MAX_KILOBYTES (INT_MAX / 1024)
|
||||
#endif
|
||||
|
||||
#define KB_PER_MB (1024)
|
||||
#define KB_PER_GB (1024*1024)
|
||||
#define KB_PER_TB (1024*1024*1024)
|
||||
@ -2550,6 +2542,17 @@ static struct config_int ConfigureNamesInt[] =
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"pending_list_cleanup_size", PGC_USERSET, CLIENT_CONN_STATEMENT,
|
||||
gettext_noop("Sets the maximum size of the pending list for GIN index."),
|
||||
NULL,
|
||||
GUC_UNIT_KB
|
||||
},
|
||||
&pending_list_cleanup_size,
|
||||
4096, 64, MAX_KILOBYTES,
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
/* End-of-list marker */
|
||||
{
|
||||
{NULL, 0, 0, NULL, NULL}, NULL, 0, 0, 0, NULL, NULL, NULL
|
||||
|
Reference in New Issue
Block a user