ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lucky <wanxing...@163.com>
Subject Re:Re: Re: Re: Re:Poor performance select query with jdbc thin mode
Date Tue, 05 Dec 2017 08:25:08 GMT
    The code is here:
    public static void main(String[] args){
try { String sql = "SELECT \"T0\".\"FID\" AS \"ID\", \"T0\".\"FCUSTOMERGROUPSTANDARDID\" AS
\"T1.ID\", \"T0\".\"FCUSTOMERGROUPID\" AS \"T2.ID\", \"T0\".\"FCUSTOMERID\" AS \"T3.ID\",
\"T0\".\"FCUSTOMERGROUPFULLNAME\" AS \"CUSTOMERGROUPFULLNAME\" FROM \"customerGroupDetailCache\".CustomerGroupDetail
AS \"T0\" INNER JOIN \"csspGroupStandardCache\".CsspGroupStandard AS \"T1\" ON \"T0\".\"FCUSTOMERGROUPSTANDARDID\"
= \"T1\".\"FID\" INNER JOIN \"customerCache\".CustomerIgniteInfo AS \"T3\" ON \"T0\".\"FCUSTOMERID\"
= \"T3\".\"FID\" WHERE (\"T3\".\"FID\" = '3NsAAABI7bq/DAQO' AND \"T1\".\"FID\" = '00000000-0000-0000-0000-000000000002BC122A7F')";
long t1 = System.currentTimeMillis(); Class.forName("org.apache.ignite.IgniteJdbcThinDriver");
Connection conn = DriverManager.getConnection("jdbc:ignite:thin://");
long t2 = System.currentTimeMillis(); logger.error("IgniteJdbcThinDriver getconn time ="+(t2-t1)+"ms");
PreparedStatement preparedStatement = conn.prepareStatement(sql); t1 = System.currentTimeMillis();
logger.error("IgniteJdbcThinDriver preparedStatement time ="+(t1-t2)+"ms"); ResultSet resultSet
= preparedStatement.executeQuery(); while (resultSet.next()) System.out.println("resultSet=="+resultSet.getObject(1));
t2 = System.currentTimeMillis();
logger.error("IgniteJdbcThinDriver execute sql time ="+(t2-t1)+"ms");
                Class.forName("org.apache.ignite.IgniteJdbcDriver"); Connection conn2 = DriverManager.getConnection("jdbc:ignite:cfg://distributedJoins=true:cache=baseUnitCache@file:D:/ignite/cof/default-config.xml");
t1 = System.currentTimeMillis(); logger.error("IgniteJdbcDriver getconn2 time ="+(t1-t2)+"ms");
PreparedStatement preparedStatement2 = conn2.prepareStatement(sql); t2 = System.currentTimeMillis();
logger.error("IgniteJdbcDriver preparedStatement2 time ="+(t2-t1)+"ms"); ResultSet resultSet2
= preparedStatement2.executeQuery(); while (resultSet2.next()) System.out.println("resultSet2==="+resultSet2.getObject(1));
t1 = System.currentTimeMillis(); logger.error("IgniteJdbcDriver execute sql2 time ="+(t1-t2)+"ms");
} catch (Exception e) { logger.error(e); } }
       the log is here:
 [(TestMain.java:417)]IgniteJdbcThinDriver getconn time =245ms
[(TestMain.java:420)]IgniteJdbcThinDriver preparedStatement time =8ms resultSet==3NsAAABJbRloQTCA
[(TestMain.java:425)]IgniteJdbcThinDriver execute sql time =2275ms [(TestMain.java:430)]IgniteJdbcDriver
getconn2 time =11172ms [(TestMain.java:433)]IgniteJdbcDriver preparedStatement2 time =2ms
resultSet2===3NsAAABJbRloQTCA [(TestMain.java:438)]IgniteJdbcDriver execute sql2 time =2836ms

    I have tried many times ,it's the same .
    This is single node. It's took double time in 3 node.

At 2017-12-05 15:12:45,"Denis Mekhanikov" <dmekhanikov@gmail.com> wrote:


I looks strange, that client driver works slower than thin. Normally it should work just like
cache.query() + network overhead.
Maybe you included connection time into your evaluation? Or something else? You should compare
query execution time, when connection is already established and all preparatory work is done.

Can you share code of your benchmark? I'd like to make sure, that all measurements are correct.

View raw message