phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

PHOENIX-5224 Change 'Statement' to 'PreparedStatement' for better performance

Open bd2019us opened this issue 6 years ago • 8 comments

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.

bd2019us avatar Apr 01 '19 22:04 bd2019us

@swaroopak Thanks for your reply. Sorry for my mistake and the compiling error is fixed, after which I run mvn compile and the output is shown below.

[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 for project 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-SNAPSHOT in 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.

bd2019us avatar Apr 07 '19 16:04 bd2019us

make sure to have imported all the packages and run mvn clean install

swaroopak avatar Apr 09 '19 23:04 swaroopak

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] ------------------------------------------------------------------------

bd2019us avatar Apr 12 '19 03:04 bd2019us

@bd2019us could you as well submit the patch. So that nightly tests run on your patch?

swaroopak avatar Apr 19 '19 21:04 swaroopak

Sure @swaroopak , I updated the patch on JIRA

bd2019us avatar Apr 24 '19 19:04 bd2019us

@bd2019us - changes look good - could you please rebase so that they can be committed?

gjacoby126 avatar Sep 09 '19 18:09 gjacoby126

@gjacoby126 - thanks, we have updated the PR with rebase correspondingly, please check it

bd2019us avatar Sep 11 '19 17:09 bd2019us

:broken_heart: -1 overall

Vote Subsystem Runtime Comment
+0 :ok: reexec 1m 1s Docker mode activated.
_ Prechecks _
+1 :green_heart: dupname 0m 0s No case conflicting files found.
+1 :green_heart: hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 :green_heart: @author 0m 0s The patch does not contain any @author tags.
-1 :x: test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 :green_heart: mvninstall 23m 51s master passed
+0 hbaserecompile 31m 1s HBase recompiled.
+1 :green_heart: compile 1m 4s master passed
+1 :green_heart: checkstyle 1m 2s master passed
+1 :green_heart: javadoc 0m 52s master passed
+0 :ok: spotbugs 3m 22s phoenix-core in master has 973 extant spotbugs warnings.
-0 :warning: patch 3m 30s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 :green_heart: mvninstall 17m 2s the patch passed
+0 hbaserecompile 29m 7s HBase recompiled.
+1 :green_heart: compile 1m 5s the patch passed
+1 :green_heart: javac 1m 5s the patch passed
+1 :green_heart: checkstyle 1m 3s the patch passed
-1 :x: whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
+1 :green_heart: javadoc 0m 51s the patch passed
+1 :green_heart: spotbugs 3m 34s the patch passed
_ Other Tests _
+1 :green_heart: unit 121m 13s phoenix-core in the patch passed.
+1 :green_heart: asflicense 0m 15s The patch does not generate ASF License warnings.
193m 22s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-474/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR https://github.com/apache/phoenix/pull/474
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
uname Linux 625cebae4600 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / c4d297d
Default Java Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
whitespace https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-474/1/artifact/yetus-general-check/output/whitespace-eol.txt
Test Results https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-474/1/testReport/
Max. process+thread count 11400 (vs. ulimit of 30000)
modules C: phoenix-core U: phoenix-core
Console output https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-474/1/console
versions git=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

stoty avatar Aug 10 '21 10:08 stoty