Why is JDBC so slow?
От | Joseph Shraibman |
---|---|
Тема | Why is JDBC so slow? |
Дата | |
Msg-id | bj2m4q$1l2c$1@news.hub.org обсуждение исходный текст |
Ответы |
Re: Why is JDBC so slow? [Viruschecked]
Re: Why is JDBC so slow? |
Список | pgsql-jdbc |
For this test I created a table named tt with ten entries in it. These selects thus select 10^6 rows. As you can see time for jdbc is much slower than psql. Why is this? The code for JDBCclient is at: http://www.tupari.net/JDBCclient.java Tests were run on pg 7.4b2 on a redhat 9 machine with java 1.4.2_01 ]$ time psql -c "select 'blah' from tt tta, tt ttb, tt ttc, tt ttd, tt tte, tt ttf;" playpen > /dev/null real 0m4.321s user 0m1.390s sys 0m0.150s ]$ time java -Xmx256m JDBCclient -U postgres -h localhost -c "select 'blah' from tt tta, tt ttb, tt ttc, tt ttd, tt tte, tt ttf;" playpen > /dev/null real 0m27.271s user 0m21.040s sys 0m0.710s ]$ time psql -c "select 1 from tt tta, tt ttb, tt ttc, tt ttd, tt tte, tt ttf;" playpen > /dev/null real 0m5.125s user 0m1.660s sys 0m0.030s ]$ time java -Xmx256m JDBCclient -U postgres -h localhost -c "select 1 from tt tta, tt ttb, tt ttc, tt ttd, tt tte, tt ttf;" playpen > /dev/null real 0m26.462s user 0m20.180s sys 0m0.970s
В списке pgsql-jdbc по дате отправления: