mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add temp_buffers GUC variable to allow users to determine the size
of the local buffer arena for temporary table access.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.255 2005/03/13 09:36:31 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.256 2005/03/19 23:27:07 tgl Exp $
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
@ -104,6 +104,7 @@ static const char *assign_log_error_verbosity(const char *newval, bool doit,
|
||||
GucSource source);
|
||||
static const char *assign_log_statement(const char *newval, bool doit,
|
||||
GucSource source);
|
||||
static const char *show_num_temp_buffers(void);
|
||||
static bool assign_phony_autocommit(bool newval, bool doit, GucSource source);
|
||||
static const char *assign_custom_variable_classes(const char *newval, bool doit,
|
||||
GucSource source);
|
||||
@ -144,9 +145,10 @@ bool default_with_oids = false;
|
||||
int log_min_error_statement = PANIC;
|
||||
int log_min_messages = NOTICE;
|
||||
int client_min_messages = NOTICE;
|
||||
|
||||
int log_min_duration_statement = -1;
|
||||
|
||||
int num_temp_buffers = 1000;
|
||||
|
||||
char *ConfigFileName;
|
||||
char *HbaFileName;
|
||||
char *IdentFileName;
|
||||
@ -966,6 +968,15 @@ static struct config_int ConfigureNamesInt[] =
|
||||
1000, 16, INT_MAX / BLCKSZ, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"temp_buffers", PGC_USERSET, RESOURCES_MEM,
|
||||
gettext_noop("Sets the maximum number of temporary buffers used by each session."),
|
||||
NULL
|
||||
},
|
||||
&num_temp_buffers,
|
||||
1000, 100, INT_MAX / BLCKSZ, NULL, show_num_temp_buffers
|
||||
},
|
||||
|
||||
{
|
||||
{"port", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
|
||||
gettext_noop("Sets the TCP port the server listens on."),
|
||||
@ -5496,6 +5507,19 @@ assign_log_statement(const char *newval, bool doit, GucSource source)
|
||||
return newval; /* OK */
|
||||
}
|
||||
|
||||
static const char *
|
||||
show_num_temp_buffers(void)
|
||||
{
|
||||
/*
|
||||
* We show the GUC var until local buffers have been initialized,
|
||||
* and NLocBuffer afterwards.
|
||||
*/
|
||||
static char nbuf[32];
|
||||
|
||||
sprintf(nbuf, "%d", NLocBuffer ? NLocBuffer : num_temp_buffers);
|
||||
return nbuf;
|
||||
}
|
||||
|
||||
static bool
|
||||
assign_phony_autocommit(bool newval, bool doit, GucSource source)
|
||||
{
|
||||
|
Reference in New Issue
Block a user