Postgres CPU benchmarking on my Dell Latitude E6520 laptop
I am busy reading PostgreSQL 9.0 High Performance by Smith, Gregory
Posgres db: connected via USB2 to the Postgres db on a western digital My Book Studio Edition 2 in RAID 1 (?)
psql (9.2.4)
Type "help" for help.
postgres=# \timing
Timing is on.
postgres=# select sum(ge)
postgres=# select sum(generate_series) from generate_series(1,1000000);
sum
--------------
500000500000
(1 row)
Time: 293.502 ms
postgres=# \timing
Timing is off.
postgres=# \timing
Timing is on.
postgres=# create table test (id INTEGER PRIMARY KEY);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test"
CREATE TABLE
Time: 532.280 ms
postgres=# insert into test values (generate series(1,1000000));
ERROR: syntax error at or near "series"
LINE 1: insert into test values (generate series(1,1000000));
^
Time: 0.254 ms
postgres=# explain analyze select count(*) from test;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
Aggregate (cost=40.00..40.01 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=1)
-> Seq Scan on test (cost=0.00..34.00 rows=2400 width=0) (actual time=0.001..0.001 rows=0 loops=1)
Total runtime: 0.027 ms
(3 rows)
Time: 0.618 ms
postgres=#
postgres=# insert into test values (generate_series(1,1000000));
INSERT 0 1000000
Time: 6766.835 ms
postgres=# explain analyze select count(*) from test;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
Aggregate (cost=17700.00..17700.01 rows=1 width=0) (actual time=159.381..159.381 rows=1 loops=1)
-> Seq Scan on test (cost=0.00..15045.00 rows=1062000 width=0) (actual time=0.015..99.903 rows=1000000 loops=1)
Total runtime: 159.407 ms
(3 rows)
Time: 159.823 ms
postgres=#
Posgres db: connected via USB2 to the Postgres db on a western digital My Book Studio Edition 2 in RAID 1 (?)
psql (9.2.4)
Type "help" for help.
postgres=# \timing
Timing is on.
postgres=# select sum(ge)
postgres=# select sum(generate_series) from generate_series(1,1000000);
sum
--------------
500000500000
(1 row)
Time: 293.502 ms
postgres=# \timing
Timing is off.
postgres=# \timing
Timing is on.
postgres=# create table test (id INTEGER PRIMARY KEY);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test"
CREATE TABLE
Time: 532.280 ms
postgres=# insert into test values (generate series(1,1000000));
ERROR: syntax error at or near "series"
LINE 1: insert into test values (generate series(1,1000000));
^
Time: 0.254 ms
postgres=# explain analyze select count(*) from test;
QUERY PLAN
--------------------------------------------------------------------------------------------------------
Aggregate (cost=40.00..40.01 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=1)
-> Seq Scan on test (cost=0.00..34.00 rows=2400 width=0) (actual time=0.001..0.001 rows=0 loops=1)
Total runtime: 0.027 ms
(3 rows)
Time: 0.618 ms
postgres=#
postgres=# insert into test values (generate_series(1,1000000));
INSERT 0 1000000
Time: 6766.835 ms
postgres=# explain analyze select count(*) from test;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------
Aggregate (cost=17700.00..17700.01 rows=1 width=0) (actual time=159.381..159.381 rows=1 loops=1)
-> Seq Scan on test (cost=0.00..15045.00 rows=1062000 width=0) (actual time=0.015..99.903 rows=1000000 loops=1)
Total runtime: 159.407 ms
(3 rows)
Time: 159.823 ms
postgres=#
Comments
Post a Comment