<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font size="+1"><font face="Times New Roman">I am trying a simple
access of a table and get an <font color="#ff0000">out of
memory error.</font> How do I avoid this issue. It seems I
have some configuration set wrong.<br>
<br>
Our system has 24GB of memory and is dedicated to the postgres
database.<br>
<br>
Back ground information<br>
<br>
aquarec=> explain analyze verbose select * from ens_memb;<br>
QUERY
PLAN <br>
--------------------------------------------------------------------------------------------------------------------------<br>
Seq Scan on ens_memb (cost=0.00..719893.12 rows=32216212
width=62) (actual time=4.954..37513.377 rows=32216154 loops=1)<br>
Output: id, shefpc, bwmon, ewmon, pb, tb, cdate, vdate,
source, tyr, val<br>
Total runtime: 39588.386 ms<br>
<br>
<br>
#------------------------------------------------------------------------------<br>
# RESOURCE USAGE (except WAL)<br>
#------------------------------------------------------------------------------<br>
<br>
# - Memory -<br>
<br>
shared_buffers = 6144MB # min 128kB<br>
# (change requires
restart)<br>
#temp_buffers = 8MB # min 800kB<br>
max_prepared_transactions = 5 # zero disables the
feature<br>
# (change requires
restart)<br>
# Note: Increasing max_prepared_transactions costs ~600 bytes
of shared memory<br>
# per transaction slot, plus lock space (see
max_locks_per_transaction).<br>
# It is not advisable to set max_prepared_transactions nonzero
unless you<br>
# actively intend to use prepared transactions.<br>
work_mem = 48MB # min 64kB<br>
maintenance_work_mem = 256MB # min 1MB<br>
#max_stack_depth = 2MB # min 100kB<br>
<br>
# - Kernel Resource Usage -<br>
<br>
#max_files_per_process = 1000 # min 25<br>
# (change requires
restart)<br>
#shared_preload_libraries = '' # (change requires
restart)<br>
<br>
# - Cost-Based Vacuum Delay -<br>
<br>
#vacuum_cost_delay = 0ms # 0-100 milliseconds<br>
#vacuum_cost_page_hit = 1 # 0-10000 credits<br>
#vacuum_cost_page_miss = 10 # 0-10000 credits<br>
#vacuum_cost_page_dirty = 20 # 0-10000 credits<br>
#vacuum_cost_limit = 200 # 1-10000 credits<br>
<br>
# - Background Writer -<br>
<br>
#bgwriter_delay = 200ms # 10-10000ms between
rounds<br>
#bgwriter_lru_maxpages = 100 # 0-1000 max buffers
written/round<br>
#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on
buffers scanned/round<br>
<br>
# - Asynchronous Behavior -<br>
<br>
#effective_io_concurrency = 1 # 1-1000. 0 disables
prefetching<br>
<br>
<br>
#------------------------------------------------------------------------------<br>
# WRITE AHEAD LOG<br>
#------------------------------------------------------------------------------<br>
<br>
# - Settings -<br>
<br>
#fsync = on # turns forced
synchronization on or off<br>
#synchronous_commit = on # immediate fsync at
commit<br>
#wal_sync_method = fsync # the default is the
first option <br>
# supported by the
operating system:<br>
# open_datasync<br>
# fdatasync<br>
# fsync<br>
# fsync_writethrough<br>
# open_sync<br>
#full_page_writes = on # recover from partial
page writes<br>
wal_buffers = 8MB # min 32kB<br>
# (change requires
restart)<br>
#wal_writer_delay = 200ms # 1-10000 milliseconds<br>
<br>
#commit_delay = 0 # range 0-100000, in
microseconds<br>
#commit_siblings = 5 # range 1-1000<br>
<br>
# - Checkpoints -<br>
<br>
checkpoint_segments = 32 # in logfile segments,
min 1, 16MB each<br>
#checkpoint_timeout = 5min # range 30s-1h<br>
#checkpoint_completion_target = 0.5 # checkpoint target
duration, 0.0 - 1.0<br>
#checkpoint_warning = 30s # 0 disables<br>
<br>
# - Archiving -<br>
<br>
#archive_mode = off # allows archiving to be done<br>
# (change requires restart)<br>
#archive_command = '' # command to use to archive a
logfile segment<br>
#archive_timeout = 0 # force a logfile segment switch
after this<br>
# number of seconds; 0 disables<br>
<br>
#------------------------------------------------------------------------------<br>
# QUERY TUNING<br>
#------------------------------------------------------------------------------<br>
<br>
# - Planner Method Configuration -<br>
<br>
#enable_bitmapscan = on<br>
#enable_hashagg = on<br>
#enable_hashjoin = on<br>
#enable_indexscan = on<br>
#enable_mergejoin = on<br>
#enable_nestloop = on<br>
#enable_seqscan = on<br>
#enable_sort = on<br>
#enable_tidscan = on<br>
<br>
# - Planner Cost Constants -<br>
<br>
#seq_page_cost = 1.0 # measured on an
arbitrary scale<br>
random_page_cost = 3.0 # same scale as above<br>
#cpu_tuple_cost = 0.01 # same scale as above<br>
#cpu_index_tuple_cost = 0.005 # same scale as above<br>
#cpu_operator_cost = 0.0025 # same scale as above<br>
effective_cache_size = 12288MB<br>
<br>
# - Genetic Query Optimizer -<br>
<br>
#geqo = on<br>
#geqo_threshold = 12<br>
#geqo_effort = 5 # range 1-10<br>
#geqo_pool_size = 0 # selects default based
on effort<br>
#geqo_generations = 0 # selects default based
on effort<br>
#geqo_selection_bias = 2.0 # range 1.5-2.0<br>
<br>
# - Other Planner Options -<br>
<br>
default_statistics_target = 100 # range 1-10000<br>
#constraint_exclusion = partition # on, off, or partition<br>
#cursor_tuple_fraction = 0.1 # range 0.0-1.0<br>
#from_collapse_limit = 8<br>
#join_collapse_limit = 8 # 1 disables collapsing
of explicit <br>
# JOIN clauses<br>
</font></font>
</body>
</html>