Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-5224 Change 'Statement' to 'PreparedStatement' for better performance - #474
PHOENIX-5224 Change 'Statement' to 'PreparedStatement' for better performance#474bd2019us wants to merge 10 commits into
Conversation
| stmt.executeUpdate( | ||
| "UPSERT INTO " + tableName + " VALUES('" + getRandomOrgId(maxOrgId) + "'," + i | ||
| + "," + (i + 1) + "," + (i + 2) + ")"); | ||
| stmt.setString(1, getRandomOrgId(maxOrgId); |
| conn.createStatement().execute("CREATE "+(localIndex? "LOCAL " : "")+"INDEX " + indexName + " ON " + fullTableName + "(val)"); | ||
| conn.createStatement().execute("UPSERT INTO " + fullTableName + " VALUES (NEXT VALUE FOR " + seqName + ",1)"); | ||
| PreparedStatement stmt = comm.prepareStatement("UPSERT INTO " + fullTableName + " SELECT NEXT VALUE FOR " + seqName + ", val FROM " + fullTableName); |
| @@ -104,9 +105,9 @@ public void testUpsertSelectDoesntSeeUpsertedData() throws Exception { | |||
| conn.createStatement().execute("CREATE "+(localIndex? "LOCAL " : "")+"INDEX " + indexName + " ON " + fullTableName + "(val)"); | |||
There was a problem hiding this comment.
while you are at it, Could you please logically separate this line of code? Lots of things happening in one line.
Thanks.
@swaroopak Thanks for your reply. Sorry for my mistake and the compiling error is fixed, after which I run [INFO] Apache Phoenix ..................................... SUCCESS [ 0.564 s]
[INFO] Phoenix Core ....................................... SUCCESS [ 20.598 s]
[INFO] Phoenix - Pherf .................................... FAILURE [ 0.157 s]
[INFO] Phoenix Client ..................................... SKIPPED
[INFO] Phoenix Server ..................................... SKIPPED
[INFO] Phoenix Assembly ................................... SKIPPED
[INFO] Phoenix - Tracing Web Application .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.960 s
[INFO] Finished at: 2019-04-07T11:17:44-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project phoenix-pherf: Could not resolve dependencies forproject org.apache.phoenix:phoenix-pherf:jar:5.1.0-HBase-2.0-SNAPSHOT: Failure to find org.apache.phoenix:phoenix-core:jar:tests:5.1.0-HBase-2.0-SNAPSHOTin https://repository.apache.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of apache release has elapsed or updates are forced -> [Help 1]Since I only changed the code in "Phoenix-core", I have no idea about the failure in "Phoenix - Pherf" , Could you kindly help. Thanks. |
swaroopak
commented
Apr 9, 2019
make sure to have imported all the packages and run mvn clean install |
bd2019us
commented
Apr 12, 2019
The compilation error is fixed. Could your please check? [INFO] stopped o.e.j.s.h.ContextHandler{/webjars,file:/home/jiajun/empirical_pr/phoenix/}
[INFO] stopped o.e.j.s.h.ContextHandler{/classpath,file:/home/jiajun/empirical_pr/phoenix/}
[INFO] stopped o.e.j.s.h.ContextHandler{/,file:/home/jiajun/empirical_pr/phoenix/}
[INFO] stopped o.e.j.s.h.ContextHandler{/spec,file:/home/jiajun/empirical_pr/phoenix/}
[INFO] stopped o.e.j.s.h.ContextHandler{/src,file:/home/jiajun/empirical_pr/phoenix/}
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Phoenix 5.1.0-HBase-2.0-SNAPSHOT:
[INFO]
[INFO] Apache Phoenix ..................................... SUCCESS [ 2.114 s]
[INFO] Phoenix Core ....................................... SUCCESS [01:54 min]
[INFO] Phoenix - Pherf .................................... SUCCESS [ 13.054 s]
[INFO] Phoenix Client ..................................... SUCCESS [ 0.999 s]
[INFO] Phoenix Server ..................................... SUCCESS [ 2.929 s]
[INFO] Phoenix Assembly ................................... SUCCESS [ 7.306 s]
[INFO] Phoenix - Tracing Web Application .................. SUCCESS [ 11.253 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:35 min
[INFO] Finished at: 2019-04-11T15:32:37-05:00
[INFO] ------------------------------------------------------------------------ |
swaroopak
commented
Apr 19, 2019
@bd2019us could you as well submit the patch. So that nightly tests run on your patch? |
bd2019us
commented
Apr 24, 2019
Sure @swaroopak , I updated the patch on JIRA |
gjacoby126
commented
Sep 9, 2019
@bd2019us - changes look good - could you please rebase so that they can be committed? |
bd2019us
commented
Sep 11, 2019
@gjacoby126 - thanks, we have updated the PR with rebase correspondingly, please check it |
stoty
commented
Aug 10, 2021
💔 -1 overall
This message was automatically generated. |
Fix: #PHOENIX-5224. When the same SQL query is intensively used in a loop, it should be replaced with PreparedStatement, which is a big gain on performance.