The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.

Why are queries executed in java so much slower than vsql?

From vsql with timings turned on (\timing) the simple query of “select 1+1” returns in 8.6ms. dbadmin=> \timing Timing is on. dbadmin=> select 1+1; ?column? ---------- 2 (1 row) Time: First fetch (1 row): 8.657 ms. All rows formatted: 8.705 ms If I write a java app to execute the same query, it takes 7 times longer. Why? [email protected]:~/testvertica$ java -cp vertica-jdk5-6.1.3-0.jar:. RunVerticaQuery jdbc:vertica://localhost:5433/vmartdb dbadmin popchart "select 1+1" Response: 38ms Metadata: 0ms Read 1 rows in 23ms Total Duration: 61ms [email protected]:~/testvertica$ java -cp vertica-jdk5-6.1.3-0.jar:. RunVerticaQuery jdbc:vertica://localhost:5433/vmartdb dbadmin popchart "select 1+1" Response: 45ms Metadata: 0ms Read 1 rows in 25ms Total Duration: 71ms [email protected]:~/testvertica$ java -cp vertica-jdk5-6.1.3-0.jar:. RunVerticaQuery jdbc:vertica://localhost:5433/vmartdb dbadmin popchart "select 1+1" Response: 39ms Metadata: 0ms Read 1 rows in 23ms Total Duration: 62ms

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.