X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CF12032A508 for ; Sun, 3 Oct 2004 04:09:14 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47023-06 for ; Sun, 3 Oct 2004 03:09:10 +0000 (GMT) Received: from csnet.cs.odu.edu (oscar.csnet.cs.odu.edu [128.82.4.55]) by svr1.postgresql.org (Postfix) with ESMTP id DBE5932A504 for ; Sun, 3 Oct 2004 04:09:05 +0100 (BST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4A8F6.56A539E8" Subject: Help needed in setting parameters for postgresql.conf X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Sat, 2 Oct 2004 23:09:01 -0400 Message-ID: <5F9FDF760B1A484C996826A76232DA022C1BDF@oscar.csnet.cs.odu.edu> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Help needed in setting parameters for postgresql.conf Thread-Index: AcSo9lS5YNoqogq/S3CCJ2DEai2oXA== From: "Madhukar Gole" To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE, LINES_OF_YELLING, LINES_OF_YELLING_2 X-Spam-Level: X-Archive-Number: 200410/67 X-Sequence-Number: 15060 This is a multi-part message in MIME format. ------_=_NextPart_001_01C4A8F6.56A539E8 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi I am working on a real time application. I have a table which has 10000 rows and 31 columns.It is updated every 5 se= cs.But only a max of 5000 rows may be updated.And Updates effect only about= 10 columns. The postgresql.conf file is given below.I donot know what values the parame= ters should take in order for the queries on this table to work effiecientl= y. Please help me out postgresql.conf # ----------------------------- # PostgreSQL configuration file # ----------------------------- # # This file consists of lines of the form: # # name =3D value # # (The '=3D' is optional.) White space may be used. Comments are introduced # with '#' anywhere on a line. The complete list of option names and # allowed values can be found in the PostgreSQL documentation. The # commented-out settings shown in this file represent the default values. # # Any option can also be given as a command line switch to the # postmaster, e.g. 'postmaster -c log_connections=3Don'. Some options # can be changed at run-time with the 'SET' SQL command. # # This file is read on postmaster startup and when the postmaster # receives a SIGHUP. If you edit the file on a running system, you have=20 # to SIGHUP the postmaster for the changes to take effect, or use=20 # "pg_ctl reload". #--------------------------------------------------------------------------- # CONNECTIONS AND AUTHENTICATION #--------------------------------------------------------------------------- # - Connection Settings - tcpip_socket =3D true max_connections =3D 100 # note: increasing max_connections costs about 500 bytes of shared # memory per connection slot, in addition to costs from shared_buffers # and max_locks_per_transaction. superuser_reserved_connections =3D 2 port =3D 5432 #unix_socket_directory =3D '' #unix_socket_group =3D '' #unix_socket_permissions =3D 0777 # octal #virtual_host =3D '' # what interface to listen on; defaults to any #rendezvous_name =3D '' # defaults to the computer name # - Security & Authentication - #authentication_timeout =3D 60 # 1-600, in seconds #ssl =3D false password_encryption =3D true #krb_server_keyfile =3D '' #db_user_namespace =3D false #--------------------------------------------------------------------------- # RESOURCE USAGE (except WAL) #--------------------------------------------------------------------------- # - Memory - shared_buffers =3D 1000 # min 16, at least max_connections*2, 8KB each #sort_mem =3D 1024 # min 64, size in KB #vacuum_mem =3D 8192 # min 1024, size in KB # - Free Space Map - #max_fsm_pages =3D 20000 # min max_fsm_relations*16, 6 bytes each #max_fsm_relations =3D 1000 # min 100, ~50 bytes each # - Kernel Resource Usage - #max_files_per_process =3D 1000 # min 25 #preload_libraries =3D '' #--------------------------------------------------------------------------- # WRITE AHEAD LOG #--------------------------------------------------------------------------- # - Settings - #fsync =3D true # turns forced synchronization on or off #wal_sync_method =3D fsync # the default varies across platforms: # fsync, fdatasync, open_sync, or open_datasync #wal_buffers =3D 8 # min 4, 8KB each # - Checkpoints - checkpoint_segments =3D 7 # in logfile segments, min 1, 16MB each #checkpoint_timeout =3D 300 # range 30-3600, in seconds #checkpoint_warning =3D 30 # 0 is off, in seconds #commit_delay =3D 0 # range 0-100000, in microseconds #commit_siblings =3D 5 # range 1-1000 #--------------------------------------------------------------------------- # QUERY TUNING #--------------------------------------------------------------------------- # - Planner Method Enabling - #enable_hashagg =3D true #enable_hashjoin =3D true #enable_indexscan =3D true #enable_mergejoin =3D true #enable_nestloop =3D true #enable_seqscan =3D true #enable_sort =3D true #enable_tidscan =3D true # - Planner Cost Constants - #effective_cache_size =3D 1000 # typically 8KB each #random_page_cost =3D 4 # units are one sequential page fetch cost #cpu_tuple_cost =3D 0.01 # (same) #cpu_index_tuple_cost =3D 0.001 # (same) #cpu_operator_cost =3D 0.0025 # (same) # - Genetic Query Optimizer - #geqo =3D true #geqo_threshold =3D 11 #geqo_effort =3D 1 #geqo_generations =3D 0 #geqo_pool_size =3D 0 # default based on tables in statement, # range 128-1024 #geqo_selection_bias =3D 2.0 # range 1.5-2.0 # - Other Planner Options - #default_statistics_target =3D 10 # range 1-1000 #from_collapse_limit =3D 8 #join_collapse_limit =3D 8 # 1 disables collapsing of explicit JOINs #--------------------------------------------------------------------------- # ERROR REPORTING AND LOGGING #--------------------------------------------------------------------------- # - Syslog - #syslog =3D 0 # range 0-2; 0=3Dstdout; 1=3Dboth; 2=3Dsyslog #syslog_facility =3D 'LOCAL0' #syslog_ident =3D 'postgres' # - When to Log - #client_min_messages =3D notice # Values, in order of decreasing detail: # debug5, debug4, debug3, debug2, debug1, # log, info, notice, warning, error #log_min_messages =3D notice # Values, in order of decreasing detail: # debug5, debug4, debug3, debug2, debug1, # info, notice, warning, error, log, fatal, # panic #log_error_verbosity =3D default # terse, default, or verbose messages #log_min_error_statement =3D panic # Values in order of increasing severity: # debug5, debug4, debug3, debug2, debug1, # info, notice, warning, error, panic(off) #log_min_duration_statement =3D -1 # Log all statements whose # execution time exceeds the value, in # milliseconds. Zero prints all queries. # Minus-one disables. #silent_mode =3D false # DO NOT USE without Syslog! # - What to Log - #debug_print_parse =3D false #debug_print_rewritten =3D false #debug_print_plan =3D false #debug_pretty_print =3D false #log_connections =3D false #log_duration =3D false #log_pid =3D false #log_statement =3D false #log_timestamp =3D false #log_hostname =3D false #log_source_port =3D false #--------------------------------------------------------------------------- # RUNTIME STATISTICS #--------------------------------------------------------------------------- # - Statistics Monitoring - #log_parser_stats =3D false #log_planner_stats =3D false #log_executor_stats =3D false #log_statement_stats =3D false # - Query/Index Statistics Collector - #stats_start_collector =3D true #stats_command_string =3D false #stats_block_level =3D false #stats_row_level =3D false #stats_reset_on_server_start =3D true #--------------------------------------------------------------------------- # CLIENT CONNECTION DEFAULTS #--------------------------------------------------------------------------- # - Statement Behavior - #search_path =3D '$user,public' # schema names #check_function_bodies =3D true #default_transaction_isolation =3D 'read committed' #default_transaction_read_only =3D false #statement_timeout =3D 0 # 0 is disabled, in milliseconds # - Locale and Formatting - #datestyle =3D 'iso, mdy' #timezone =3D unknown # actually, defaults to TZ environment setting #australian_timezones =3D false #extra_float_digits =3D 0 # min -15, max 2 #client_encoding =3D sql_ascii # actually, defaults to database encoding # These settings are initialized by initdb -- they may be changed lc_messages =3D 'en_US.UTF-8' # locale for system error message string s lc_monetary =3D 'en_US.UTF-8' # locale for monetary formatting lc_numeric =3D 'en_US.UTF-8' # locale for number formatting lc_time =3D 'en_US.UTF-8' # locale for time formatting # - Other Defaults - #explain_pretty_print =3D true #dynamic_library_path =3D '$libdir' max_expr_depth =3D 100000 # min 10 #--------------------------------------------------------------------------- # LOCK MANAGEMENT #--------------------------------------------------------------------------- #deadlock_timeout =3D 1000 # in milliseconds #max_locks_per_transaction =3D 64 # min 10, ~260*max_connections bytes each #--------------------------------------------------------------------------- # VERSION/PLATFORM COMPATIBILITY #--------------------------------------------------------------------------- # - Previous Postgres Versions - #add_missing_from =3D true #regex_flavor =3D advanced # advanced, extended, or basic #sql_inheritance =3D true # - Other Platforms & Clients - #transform_null_equals =3D false bash-2.05b$=20 Thanks Madhukar ------_=_NextPart_001_01C4A8F6.56A539E8 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi

I am working on a real= time=20 application.
I have a table which has 10000 rows and 31 columns.It is up= dated=20 every 5 secs.But only a max of 5000 rows may be updated.And Updates effect = only=20 about 10 columns.

The postgresql.conf file is given below.I donot kn= ow=20 what values the parameters should take in order for the queries on this tab= le to=20 work effieciently.

Please help me out

postgresql.conf

=
#=20 -----------------------------
# PostgreSQL configuration file
#=20 -----------------------------
#
# This file consists of lines of the= =20 form:
#
# name =3D value
#
# (The '=3D' is optional.) White spa= ce may be=20 used. Comments are introduced
# with '#' anywhere on a line. The complet= e=20 list of option names and
# allowed values can be found in the PostgreSQL= =20 documentation. The
# commented-out settings shown in this file represent= the=20 default values.
#
# Any option can also be given as a command line sw= itch=20 to the
# postmaster, e.g. 'postmaster -c log_connections=3Don'. Some=20 options
# can be changed at run-time with the 'SET' SQL command.
##=20 This file is read on postmaster startup and when the postmaster
# receiv= es a=20 SIGHUP. If you edit the file on a running system, you have
# to SIGHUP = the=20 postmaster for the changes to take effect, or use
# "pg_ctl=20 reload".


#------------------------------------------------------= ---------------------
#=20 CONNECTIONS AND=20 AUTHENTICATION
#--------------------------------------------------------= -------------------

#=20 - Connection Settings -

tcpip_socket =3D true
max_connections =3D= 100
#=20 note: increasing max_connections costs about 500 bytes of shared
# memor= y per=20 connection slot, in addition to costs from shared_buffers
# and=20 max_locks_per_transaction.
superuser_reserved_connections =3D 2
port = =3D=20 5432
#unix_socket_directory =3D ''
#unix_socket_group =3D=20 ''
#unix_socket_permissions =3D 0777 # octal
#virtual_host =3D '' # w= hat=20 interface to listen on; defaults to any
#rendezvous_name =3D '' # defaul= ts to=20 the computer name

# - Security & Authentication=20 -

#authentication_timeout =3D 60 # 1-600, in seconds
#ssl =3D=20 false
password_encryption =3D true
#krb_server_keyfile =3D=20 ''
#db_user_namespace =3D=20 false


#---------------------------------------------------------= ------------------
#=20 RESOURCE USAGE (except=20 WAL)
#------------------------------------------------------------------= ---------

#=20 - Memory -

shared_buffers =3D 1000 # min 16, at least max_connection= s*2,=20 8KB each
#sort_mem =3D 1024 # min 64, size in KB
#vacuum_mem =3D 8192= # min=20 1024, size in KB

# - Free Space Map -

#max_fsm_pages =3D 2000= 0 # min=20 max_fsm_relations*16, 6 bytes each
#max_fsm_relations =3D 1000 # min 100= , ~50=20 bytes each

# - Kernel Resource Usage -

#max_files_per_process= =3D=20 1000 # min 25
#preload_libraries =3D=20 ''


#------------------------------------------------------------= ---------------
#=20 WRITE AHEAD=20 LOG
#-------------------------------------------------------------------= --------

#=20 - Settings -

#fsync =3D true # turns forced synchronization on or=20 off
#wal_sync_method =3D fsync # the default varies across platforms:#=20 fsync, fdatasync, open_sync, or open_datasync
#wal_buffers =3D 8 # min 4= , 8KB=20 each

# - Checkpoints -

checkpoint_segments =3D 7 # in logfile= =20 segments, min 1, 16MB each
#checkpoint_timeout =3D 300 # range 30-3600, = in=20 seconds
#checkpoint_warning =3D 30 # 0 is off, in seconds
#commit_del= ay =3D 0=20 # range 0-100000, in microseconds
#commit_siblings =3D 5 # range=20 1-1000


#--------------------------------------------------------= -------------------
#=20 QUERY=20 TUNING
#----------------------------------------------------------------= -----------

#=20 - Planner Method Enabling -

#enable_hashagg =3D true
#enable_hash= join =3D=20 true
#enable_indexscan =3D true
#enable_mergejoin =3D true
#enable= _nestloop=20 =3D true
#enable_seqscan =3D true
#enable_sort =3D true
#enable_ti= dscan =3D=20 true

# - Planner Cost Constants -

#effective_cache_size =3D 1= 000 #=20 typically 8KB each
#random_page_cost =3D 4 # units are one sequential pa= ge=20 fetch cost
#cpu_tuple_cost =3D 0.01 # (same)
#cpu_index_tuple_cost = =3D 0.001 #=20 (same)
#cpu_operator_cost =3D 0.0025 # (same)

# - Genetic Query= =20 Optimizer -

#geqo =3D true
#geqo_threshold =3D 11
#geqo_effort= =3D=20 1
#geqo_generations =3D 0
#geqo_pool_size =3D 0 # default based on ta= bles in=20 statement,
# range 128-1024
#geqo_selection_bias =3D 2.0 # range=20 1.5-2.0

# - Other Planner Options -

#default_statistics_targe= t =3D=20 10 # range 1-1000
#from_collapse_limit =3D 8
#join_collapse_limit =3D= 8 # 1=20 disables collapsing of explicit=20 JOINs


#---------------------------------------------------------= ------------------
#=20 ERROR REPORTING AND=20 LOGGING
#---------------------------------------------------------------= ------------

#=20 - Syslog -

#syslog =3D 0 # range 0-2; 0=3Dstdout; 1=3Dboth;=20 2=3Dsyslog
#syslog_facility =3D 'LOCAL0'
#syslog_ident =3D 'postgres'=

# -=20 When to Log -

#client_min_messages =3D notice # Values, in order of= =20 decreasing detail:
# debug5, debug4, debug3, debug2, debug1,
# log, i= nfo,=20 notice, warning, error

#log_min_messages =3D notice # Values, in ord= er of=20 decreasing detail:
# debug5, debug4, debug3, debug2, debug1,
# info,= =20 notice, warning, error, log, fatal,
# panic

#log_error_verbosity = =3D=20 default # terse, default, or verbose messages

#log_min_error_stateme= nt =3D=20 panic # Values in order of increasing severity:
# debug5, debug4, debug3= ,=20 debug2, debug1,
# info, notice, warning, error,=20 panic(off)

#log_min_duration_statement =3D -1 # Log all statements= =20 whose
# execution time exceeds the value, in
# milliseconds. Zero pri= nts=20 all queries.
# Minus-one disables.

#silent_mode =3D false # DO NO= T USE=20 without Syslog!

# - What to Log -

#debug_print_parse =3D=20 false
#debug_print_rewritten =3D false
#debug_print_plan =3D=20 false
#debug_pretty_print =3D false
#log_connections =3D=20 false
#log_duration =3D false
#log_pid =3D false
#log_statement = =3D=20 false
#log_timestamp =3D false
#log_hostname =3D false
#log_source= _port =3D=20 false


#---------------------------------------------------------= ------------------
#=20 RUNTIME=20 STATISTICS
#------------------------------------------------------------= ---------------

#=20 - Statistics Monitoring -

#log_parser_stats =3D false
#log_planne= r_stats=20 =3D false
#log_executor_stats =3D false
#log_statement_stats =3D fals= e

#=20 - Query/Index Statistics Collector -

#stats_start_collector =3D=20 true
#stats_command_string =3D false
#stats_block_level =3D=20 false
#stats_row_level =3D false
#stats_reset_on_server_start =3D=20 true


#----------------------------------------------------------= -----------------
#=20 CLIENT CONNECTION=20 DEFAULTS
#--------------------------------------------------------------= -------------

#=20 - Statement Behavior -

#search_path =3D '$user,public' # schema=20 names
#check_function_bodies =3D true
#default_transaction_isolation = =3D 'read=20 committed'
#default_transaction_read_only =3D false
#statement_timeou= t =3D 0 #=20 0 is disabled, in milliseconds

# - Locale and Formatting=20 -

#datestyle =3D 'iso, mdy'
#timezone =3D unknown # actually, def= aults to=20 TZ environment setting
#australian_timezones =3D false
#extra_float_d= igits =3D=20 0 # min -15, max 2
#client_encoding =3D sql_ascii # actually, defaults t= o=20 database encoding

# These settings are initialized by initdb -- they= may=20 be changed
lc_messages =3D 'en_US.UTF-8' # locale for system error messa= ge=20 string
s
lc_monetary =3D 'en_US.UTF-8' # locale for monetary=20 formatting
lc_numeric =3D 'en_US.UTF-8' # locale for number=20 formatting
lc_time =3D 'en_US.UTF-8' # locale for time formatting
# -=20 Other Defaults -

#explain_pretty_print =3D true
#dynamic_library_= path =3D=20 '$libdir'
max_expr_depth =3D 100000 # min=20 10


#------------------------------------------------------------= ---------------
#=20 LOCK=20 MANAGEMENT
#------------------------------------------------------------= ---------------

#deadlock_timeout=20 =3D 1000 # in milliseconds
#max_locks_per_transaction =3D 64 # min 10,= =20 ~260*max_connections bytes=20 each


#----------------------------------------------------------= -----------------
#=20 VERSION/PLATFORM=20 COMPATIBILITY
#---------------------------------------------------------= ------------------

#=20 - Previous Postgres Versions -

#add_missing_from =3D true
#regex_= flavor=20 =3D advanced # advanced, extended, or basic
#sql_inheritance =3D true
# -=20 Other Platforms & Clients -

#transform_null_equals =3D=20 false
bash-2.05b$=20



Thanks

Madhukar

= ------_=_NextPart_001_01C4A8F6.56A539E8--