LINUX.ORG.RU

Eto mozhet byt' pravdoi?! PGSQL & MySQL comparison (connect from C++)


0

0

Can this be true or have i fucked up somewhere?
Zaranee Spasibo.

well here it goes:
the programs do 10000 INSERT OPERATIONS of (int id, char[20] name, int sid ), where SID is primary key.
than 5000 select by sid , 3333 update by SID (name is updated) , 10000 select by name using LIKE 
here are the results:
----------------------------------------------------
INSERT:

[vadick@iua142 cc]$ time ./testMSQ
START!
0.37user 0.27system 0:01.93elapsed 33%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (286major+122minor)pagefaults 0swaps


[postgres@iua142 test.cpp]$ time ./a.out 
0.27user 0.21system 0:26.17elapsed 1%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (224major+88minor)pagefaults 0swaps

INSERT + SELECT by int EQ

[vadick@iua142 cc]$ time ./testMSQ
START!
0.80user 0.48system 0:03.24elapsed 39%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (293major+467minor)pagefaults 0swaps


[postgres@iua142 test.cpp]$ time ./a.out 
0.51user 0.38system 0:29.25elapsed 3%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (224major+108minor)pagefaults 0swaps

INSERT + SELECT by int EQ + UPDATE by int EQ 
[vadick@iua142 cc]$ time ./testMSQ
START!
0.89user 0.52system 0:04.02elapsed 35%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (294major+478minor)pagefaults 0swaps

[postgres@iua142 test.cpp]$ time ./a.out 
0.56user 0.39system 0:39.76elapsed 2%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (224major+123minor)pagefaults 0swaps

INSERT + SELECT by int EQ + UPDATE by int EQ + SELECT by string LIKE
on nonindexed char(20) field

[vadick@iua142 cc]$ time ./testMSQ
START!
2.42user 1.17system 1:30.73elapsed 3%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (294major+1128minor)pagefaults 0swaps

[postgres@iua142 test.cpp]$ time ./a.out 
1.47user 0.99system 15:55.00elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (224major+121minor)pagefaults 0swaps

INSERT (name column is INDEXED)
[vadick@iua142 cc]$ time ./testMSQ
START!
0.50user 0.14system 0:02.82elapsed 22%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (287major+122minor)pagefaults 0swaps

[postgres@iua142 test.cpp]$ time ./a.out 
0.41user 0.24system 0:36.79elapsed 1%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (224major+88minor)pagefaults 0swaps

INSERT + SELECT by int EQ + update by int EQ (column name INDEXED)
[vadick@iua142 cc]$ time ./testMSQ
START!
1.04user 0.56system 0:05.65elapsed 28%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (294major+478minor)pagefaults 0swaps

[postgres@iua142 test.cpp]$ time ./a.out 
0.81user 0.53system 1:40.02elapsed 1%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (224major+123minor)pagefaults 0swaps

SELECT BY string LIKE INDEXED
[vadick@iua142 cc]$ time ./testMSQ
START!
0.76user 0.35system 0:04.33elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (292major+729minor)pagefaults 0swaps

[postgres@iua142 test.cpp]$ time ./a.out 
0.30user 0.18system 0:10.57elapsed 4%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (223major+49minor)pagefaults 0swaps

INSERT + SELECT by int EQ + UPDATE by int EQ + SELECT by string LIKE
(string INDEXED)

[vadick@iua142 cc]$ time ./testMSQ
START!
1.81user 0.86system 0:09.75elapsed 27%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (294major+1128minor)pagefaults 0swaps

[postgres@iua142 test.cpp]$ time ./a.out 
0.76user 0.85system 2:58.85elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (224major+121minor)pagefaults 0swaps
anonymous

Re: Eto mozhet byt' pravdoi?! PGSQL & MySQL comparison (connect from C++)

Mozhet :)

master ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.