:) 我有 Gentoo Linux,带有 postgresql 11.4 和 timescaledb-1.3.2。我执行了 timescaledb-tune 来调整我的 postgresql 数据库配置。
我创建了一个包含 30 个字段的表,我们称之为 foo。我创建了另一个重复的表,只是将它创建为一个超表,我们称之为 h_foo。
我有一个 4gb 的 csv 文件,我尝试使用COPY ... FROM ...
命令将其加载到数据库中
当我尝试将数据加载到常规表时,只需不到一分钟,就可以了。
当我尝试将它加载到超表时,过了一会儿它抱怨它的共享内存不足,并且需要很长时间才能到达错误点。
我认为使用 timescaledb 开箱即用(不知道高级配置)值得付出努力,但我不确定了。
我将在下面粘贴我的 postgresql 配置文件,请告诉我是否有任何可以修改的内容,谁能帮助我加载该 csv 文件。
谢谢你
shared_buffers = 8009MB # min 128kB
work_mem = 6835kB # min 64kB
maintenance_work_mem = 2047MB # min 1MB
dynamic_shared_memory_type = posix # the default is the first option
effective_io_concurrency = 200 # 1-1000; 0 disables prefetching
max_worker_processes = 23 # (change requires restart)
max_parallel_workers_per_gather = 6 # taken from max_parallel_workers
max_parallel_workers = 12 # maximum number of max_worker_processes that
wal_buffers = 16MB # min 32kB, -1 sets based on shared_buffers
max_wal_size = 8GB
min_wal_size = 4GB
checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0
random_page_cost = 1.1 # same scale as above
effective_cache_size = 24029MB
default_statistics_target = 500 # range 1-10000
log_timezone = 'Israel'
datestyle = 'iso, mdy'
timezone = 'Israel'
lc_messages = 'en_US.utf8' # locale for system error message
# strings
lc_monetary = 'en_US.utf8' # locale for monetary formatting
lc_numeric = 'en_US.utf8' # locale for number formatting
lc_time = 'en_US.utf8' # locale for time formatting
default_text_search_config = 'pg_catalog.english'
shared_preload_libraries = 'timescaledb'
max_locks_per_transaction = 256 # min 10
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
timescaledb.max_background_workers = 8
timescaledb.last_tuned = '2019-07-14T16:06:04+03:00'
timescaledb.last_tuned_version = '0.6.0'