亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: postgresql有可能在win下優(yōu)化到一秒鐘插入一萬(wàn)條記錄嗎?(非ssd) [打印本頁(yè)]

作者: 一只嗡嗡的蒼蠅    時(shí)間: 2014-01-27 20:25
標(biāo)題: postgresql有可能在win下優(yōu)化到一秒鐘插入一萬(wàn)條記錄嗎?(非ssd)
如果有可能的話,我也會(huì)轉(zhuǎn)向postgresql,目前我沒(méi)有搞成功過(guò)。
機(jī)器就是普通的core 5870這種,5400轉(zhuǎn)的硬盤。
因?yàn)閙ysql,oracle的性能都有可能達(dá)到這么多。

作者: tanfeng3    時(shí)間: 2014-01-28 09:02
看看德哥的這個(gè)帖子,批量插入,最高可達(dá)插入 249088 條數(shù)據(jù)每秒,詳見(jiàn)
http://blog.163.com/digoal@126/b ... 040201242331551545/

測(cè)試環(huán)境:
PostgreSQL 9.2 beta1
CentOS 5.x 64bit
HP DL360G5
2 * Intel(R) Xeon(R) CPU           E5440  @ 2.83GHz CPU
SAS 146GB硬盤
作者: 一只嗡嗡的蒼蠅    時(shí)間: 2014-01-28 09:44
硬件沒(méi)一個(gè)符合,win,5400轉(zhuǎn)硬盤,core 5870左右。
作者: tanfeng3    時(shí)間: 2014-01-28 10:30
本帖最后由 tanfeng3 于 2014-01-28 10:44 編輯

如果覺(jué)得帖子不好,就算我沒(méi)說(shuō)好了,樓主可以選擇不看, 想在 win 下把數(shù)據(jù)庫(kù)性能發(fā)揮極致,個(gè)人覺(jué)得不合適。

而且 blog 里的批量插入方法,樓主可以 在 win 下測(cè)試下。

另外,不知道樓主 win 下的 pg 是否優(yōu)化。
作者: yueliangdao0608    時(shí)間: 2014-02-14 17:25
把你的寫語(yǔ)句以及表結(jié)構(gòu),POSTGRESQL的配置文件,詳細(xì)的硬件信息貼出來(lái),一塊來(lái)看下哦。
作者: yueliangdao0608    時(shí)間: 2014-02-14 17:25
把你的寫語(yǔ)句以及表結(jié)構(gòu),POSTGRESQL的配置文件,詳細(xì)的硬件信息貼出來(lái),一塊來(lái)看下哦。
作者: wanzai01    時(shí)間: 2014-02-15 09:46
本帖最后由 wanzai01 于 2014-02-15 09:47 編輯

我的硬件:
i5 2450M 2.5G
8G 內(nèi)存
西部數(shù)據(jù) 500G 5400轉(zhuǎn)硬盤
東芝L生活本
Win7 x64
PostgreSQL 9.3.2 for win-x64

測(cè)試如下 :
單步提交性能約1.7萬(wàn)TPS.
100條每個(gè)batch的批量提交的話性能約12.5萬(wàn)記錄每秒

E:\proc\PostgreSQL\9.3\bin>psql.exe  -U postgres postgres
用戶 postgres 的口令:
psql (9.3.2)
輸入 "help" 來(lái)獲取幫助信息.
postgres=# create database digoal with template template0 encoding 'UTF8';
CREATE DATABASE
postgres=# create role digoal nosuperuser login encrypted password 'digoal';
CREATE ROLE
postgres=# grant all on database digoal to digoal;
GRANT
postgres=# \c digoal digoal
digoal=> create schema digoal;
CREATE SCHEMA
digoal=> create table test(id serial8 primary key, info text, crt_time timestamp default clock_timestamp());
CREATE TABLE


vi $PGDATA/pg_hba.conf
host    all             all             127.0.0.1/32            trust

vi $PGDATA/postgresql.conf
shared_buffers = 2048MB
maintenance_work_mem = 256MB
vacuum_cost_delay = 10
vacuum_cost_limit = 10000
bgwriter_delay = 10ms
synchronous_commit = off
wal_buffers = 16384kB
wal_writer_delay = 10ms
checkpoint_segments = 128
effective_cache_size = 8192MB
log_destination = 'csvlog'
log_truncate_on_rotation = on
log_checkpoints = on
log_error_verbosity = verbose
log_autovacuum_min_duration = 0
autovacuum_freeze_max_age = 1500000000
vacuum_freeze_table_age = 1200000000

重啟服務(wù)

vi e:\test.sql
insert into test (info) values (md5(random()::text));


E:\proc\PostgreSQL\9.3\bin>pgbench -M prepared -n -r -f e:\test.sql -c 6 -j 2 -T
10 -U digoal digoal
transaction type: Custom query
scaling factor: 1
query mode: prepared
number of clients: 6
number of threads: 2
duration: 10 s
number of transactions actually processed: 166166
tps = 16604.667059 (including connections establishing)
tps = 17022.521990 (excluding connections establishing)
statement latencies in milliseconds:
        0.350674        insert into test (info) values (md5(random()::text));

50條一個(gè)batch, 約2.5kTPS, 轉(zhuǎn)換成記錄數(shù)約12.5萬(wàn)條每秒
E:\proc\PostgreSQL\9.3\bin>pgbench -M prepared -n -r -f e:\test.sql -c 8 -j 2 -T
10 -U digoal digoal
transaction type: Custom query
scaling factor: 1
query mode: prepared
number of clients: 8
number of threads: 2
duration: 10 s
number of transactions actually processed: 25118
tps = 2476.191514 (including connections establishing)
tps = 2549.831205 (excluding connections establishing)
statement latencies in milliseconds:
        3.130863        insert into test (info) values ('test'),('test'),('test'
),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test
'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('tes
t'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('te
st'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('t
est'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),('
test'),('test'),('test');

E:\proc\PostgreSQL\9.3\bin>psql -U digoal digoal
psql (9.3.2)
輸入 "help" 來(lái)獲取幫助信息.

digoal=> select count(*) from test;
  count
---------
1741639
(1 行記錄)


digoal=> select * from test limit 5;
id |               info               |        crt_time
----+----------------------------------+-------------------------
  1 | fcf4f7dd1d05420683596be124fb1fc8 | 2014-02-15 09:36:02.614
  2 | 8cec0d844b653441c09cbc6699ab6ed0 | 2014-02-15 09:36:02.624
  3 | b86cd74a4c069bd9967d30d65ea414f4 | 2014-02-15 09:36:02.625
  4 | f969b073918087a568d5f73135068fe7 | 2014-02-15 09:36:02.626
  5 | 24ca01ee37f66568b549678b8c98b3a0 | 2014-02-15 09:36:02.627
(5 行記錄)

如需其他幫助可瀏覽我的blog
推薦瀏覽 :
新手建議, PG優(yōu)化案例分析, PG培訓(xùn)視頻
http://blog.163.com/digoal@126/b ... 040201172183022203/
http://www.tudou.com/home/digoal
http://blog.163.com/digoal@126/b ... 7040201392641033482
http://blog.163.com/digoal@126/b ... 7040201221382150858


作者: 一只嗡嗡的蒼蠅    時(shí)間: 2014-02-15 17:44
thanks i'll try later




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2