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

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 14951 | 回復: 7
打印 上一主題 下一主題

postgresql有可能在win下優(yōu)化到一秒鐘插入一萬條記錄嗎?(非ssd) [復制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2014-01-27 20:25 |只看該作者 |倒序瀏覽
如果有可能的話,我也會轉(zhuǎn)向postgresql,目前我沒有搞成功過。
機器就是普通的core 5870這種,5400轉(zhuǎn)的硬盤。
因為mysql,oracle的性能都有可能達到這么多。

論壇徽章:
4
丑牛
日期:2014-09-15 09:28:12雙子座
日期:2014-12-19 17:01:192015年辭舊歲徽章
日期:2015-03-03 16:54:15數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-06-28 06:20:00
2 [報告]
發(fā)表于 2014-01-28 09:02 |只看該作者
看看德哥的這個帖子,批量插入,最高可達插入 249088 條數(shù)據(jù)每秒,詳見
http://blog.163.com/digoal@126/b ... 040201242331551545/

測試環(huán)境:
PostgreSQL 9.2 beta1
CentOS 5.x 64bit
HP DL360G5
2 * Intel(R) Xeon(R) CPU           E5440  @ 2.83GHz CPU
SAS 146GB硬盤

論壇徽章:
0
3 [報告]
發(fā)表于 2014-01-28 09:44 |只看該作者
硬件沒一個符合,win,5400轉(zhuǎn)硬盤,core 5870左右。

論壇徽章:
4
丑牛
日期:2014-09-15 09:28:12雙子座
日期:2014-12-19 17:01:192015年辭舊歲徽章
日期:2015-03-03 16:54:15數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2016-06-28 06:20:00
4 [報告]
發(fā)表于 2014-01-28 10:30 |只看該作者
本帖最后由 tanfeng3 于 2014-01-28 10:44 編輯

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

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

另外,不知道樓主 win 下的 pg 是否優(yōu)化。

論壇徽章:
0
5 [報告]
發(fā)表于 2014-02-14 17:25 |只看該作者
把你的寫語句以及表結(jié)構(gòu),POSTGRESQL的配置文件,詳細的硬件信息貼出來,一塊來看下哦。

論壇徽章:
0
6 [報告]
發(fā)表于 2014-02-14 17:25 |只看該作者
把你的寫語句以及表結(jié)構(gòu),POSTGRESQL的配置文件,詳細的硬件信息貼出來,一塊來看下哦。

論壇徽章:
0
7 [報告]
發(fā)表于 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

測試如下 :
單步提交性能約1.7萬TPS.
100條每個batch的批量提交的話性能約12.5萬記錄每秒

E:\proc\PostgreSQL\9.3\bin>psql.exe  -U postgres postgres
用戶 postgres 的口令:
psql (9.3.2)
輸入 "help" 來獲取幫助信息.
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條一個batch, 約2.5kTPS, 轉(zhuǎn)換成記錄數(shù)約12.5萬條每秒
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" 來獲取幫助信息.

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培訓視頻
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

論壇徽章:
0
8 [報告]
發(fā)表于 2014-02-15 17:44 |只看該作者
thanks i'll try later
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP