Hi Dave, Thanks for your reply. I am using postgresql jdbc driver. Here is my code that executes the query *Class.forName("org.postgresql.Driver"); String pConnectionStr = "jdbc:postgresql://localhost:5432/mydb"; conn = DriverManager.getConnection(pConnectionStr); String sql = "select place_id, (select count(*) from (select unnest(ARRAY[5098092,10799979,7470935,10799979,5957205,23663129]) INTERSECT select unnest(nameaddress_vector))s) as exactmatch from search_name where name_vector @> ARRAY[4784827] and nameaddress_vector @> ARRAY[17247,202321,10250,7791183,1099136,63895,202321,46909,23663130] order by (case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end) DESC, exactmatch DESC limit 2"; stmt = conn.createStatement(); stmt.executeQuery(sql)*; The above query takes 440ms in jdbc connection. But when i execute the same query in psql client,it takes only 210ms. Regards, Vijay K -- View this message in context: http://postgresql.1045698.n5.nabble.com/Slow-statement-when-using-JDBC-tp3368379p5812199.htmlSent from the PostgreSQL - jdbc mailing list archive at Nabble.com. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-jdbc
pgsql-jdbc by date:
Соглашаюсь с условиями обработки персональных данных