-bash-3.2$ gzip --stdout -d /user1/app/oradata/tpch2/lineitem.tbl.gz |sed 's/|\r/\r/' > /user1/daa &
[2] 30036
-bash-3.2$ psql pgdb
Welcome to psql 8.1.18 (server 9.0.4), the PostgreSQL interactive terminal.
Type:\copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING:You are connected to a server with major version 9.0,
but your psql client is major version 8.1.Some backslash commands,
such as \d, might not work properly.
pgdb=# \timing
Timing is on.
pgdb=# COPY lineitem FROM '/user1/daa' WITH DELIMITER AS '|';
LOG:checkpoints are occurring too frequently (3 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
COPY 59986052
Time: 555966.304 ms
pgdb=# \q
[2]+Done
gzip --stdout -d /user1/app/oradata/tpch2/lineitem.tbl.gz | sed 's/|\r/\r/' > /user1/daa
-bash-3.2$ gzip --stdout -d /user1/app/oradata/tpch2/orders.tbl.gz | sed 's/|\r/\r/' > /user1/daa
&
-bash-3.2$ ps -ef|grep gzip
-bash-3.2$ gzip --stdout -d /user1/app/oradata/tpch2/orders.tbl.gz | sed 's/|\r/\r/' > /user1/daa &
[2] 30416
-bash-3.2$ psql pgdb
Welcome to psql 8.1.18 (server 9.0.4), the PostgreSQL interactive terminal.
Type:\copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING:You are connected to a server with major version 9.0,
but your psql client is major version 8.1.Some backslash commands,
such as \d, might not work properly.
pgdb=# \timing
Timing is on.
pgdb=# COPY orders FROM '/user1/daa' WITH DELIMITER AS '|';
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
COPY 15000000
Time: 100340.255 ms
pgdb=# \q
[2]+Done
gzip --stdout -d /user1/app/oradata/tpch2/orders.tbl.gz | sed 's/|\r/\r/' > /user1/daa
-bash-3.2$ gzip --stdout -d /user1/app/oradata/tpch2/customer.tbl.gz | sed 's/|\r/\r/' > /user1/daa &
[2] 30496
-bash-3.2$ psql pgdb
Welcome to psql 8.1.18 (server 9.0.4), the PostgreSQL interactive terminal.
Type:\copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING:You are connected to a server with major version 9.0,
but your psql client is major version 8.1.Some backslash commands,
such as \d, might not work properly.
pgdb=# \timing
Timing is on.
pgdb=# COPY customer FROM '/user1/daa' WITH DELIMITER AS '|';
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (1 second apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
COPY 1500000
Time: 12022.593 ms
pgdb=# \q
[2]+Done
gzip --stdout -d /user1/app/oradata/tpch2/customer.tbl.gz | sed 's/|\r/\r/' > /user1/daa
-bash-3.2$ gzip --stdout -d /user1/app/oradata/tpch2/supplier.tbl.gz | sed 's/|\r/\r/' > /user1/daa &
[2] 30547
-bash-3.2$ psql pgdb
Welcome to psql 8.1.18 (server 9.0.4), the PostgreSQL interactive terminal.
Type:\copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING:You are connected to a server with major version 9.0,
but your psql client is major version 8.1.Some backslash commands,
such as \d, might not work properly.
pgdb=# \timing
Timing is on.
pgdb=# COPY supplier FROM '/user1/daa' WITH DELIMITER AS '|';
COPY 100000
Time: 695.210 ms
pgdb=# \q
[2]+Done
gzip --stdout -d /user1/app/oradata/tpch2/supplier.tbl.gz | sed 's/|\r/\r/' > /user1/daa
-bash-3.2$ cat /user1/app/oradata/tpch2/nation.tbl | sed 's/|\r/\r/' > /user1/daa &
[2] 30600
-bash-3.2$ psql pgdb
Welcome to psql 8.1.18 (server 9.0.4), the PostgreSQL interactive terminal.
Type:\copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING:You are connected to a server with major version 9.0,
but your psql client is major version 8.1.Some backslash commands,
such as \d, might not work properly.
pgdb=# COPY nation FROM '/user1/daa' WITH DELIMITER AS '|';
COPY 25
pgdb=# select count(*) from nation;
count
-------
25
(1 row)
pgdb=# \timing
Timing is on.
pgdb=# select count(*) from region;
count
-------
5
(1 row)
Time: 0.805 ms
pgdb=# select count(*) from partsupp;
count
---------
8000000
(1 row)
Time: 7417.778 ms
pgdb=# select count(*) from supplier;
count
--------
100000
(1 row)
Time: 26.184 ms
pgdb=# select count(*) from customer;
count
---------
1500000
(1 row)
Time: 433.348 ms
pgdb=# select count(*) from orders;
count
----------
15000000
(1 row)
Time: 12530.868 ms
pgdb=# select count(*) from lineitem;
count
----------
59986052
(1 row)
Time: 53526.482 ms
pgdb=# \q
[2]+Done
cat /user1/app/oradata/tpch2/nation.tbl | sed 's/|\r/\r/' > /user1/daa
-bash-3.2$ cat /user1/app/oradata/tpch2/part.tbl | sed 's/|\r/\r/' > /user1/daa &
[2] 30699
-bash-3.2$ psql pgdb
Welcome to psql 8.1.18 (server 9.0.4), the PostgreSQL interactive terminal.
Type:\copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING:You are connected to a server with major version 9.0,
but your psql client is major version 8.1.Some backslash commands,
such as \d, might not work properly.
pgdb=# \timing
Timing is on.
pgdb=# copy partFROM '/user1/daa' WITH DELIMITER AS '|';
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
LOG:checkpoints are occurring too frequently (2 seconds apart)
HINT:Consider increasing the configuration parameter "checkpoint_segments".
COPY 2000000
Time: 15695.787 ms
pgdb=# select count(*) from part;
count
---------
2000000
(1 row)
Time: 1871.460 ms
统计分析
pgdb=# VACUUM ANALYZE;
VACUUM
Time: 76961.460 ms
pgdb=# select count(*) from partsupp;
count
---------
8000000
(1 row)
Time: 1686.777 ms
pgdb=# select count(*) from orders;
count
----------
15000000
(1 row)
Time: 2624.166 ms
pgdb=# select count(*) from lineitem;
count
----------
59986052
(1 row)
Time: 12061.884 ms
pgdb=# select count(*) from part;
count
---------
2000000
(1 row)
Time: 419.798 ms
pgdb=#
|