QueryTime

From: Zahid Rahman <zahidr1000(at)gmail(dot)com>
To: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: QueryTime
Date: 2019-12-16 00:38:40
Message-ID: CAPGSW3RVqjR0ryZ3TEc6Q5=a-THcvJZTUf2RdwLUbCEGEuZqQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

my query times are using my program below

*connecting to Postgres Database .....John Casserole Y 2012-04-11Sandy
Key Lime Tarts N 2012-04-14Tom BBQ Y 2012-04-18Tina Salad Y
2012-04-18query time taken miiliseconds 6Connection + query time
miiliseconds 321*

pgadmin TOOL query time is a approx. *63 -66 milliseconds*
*select * from potluck;*
what time interval is being measured for that time.

*import java.sql.Connection;import java.sql.DriverManager;import
java.sql.ResultSet;import java.sql.Statement;public class QueryTable {
public static void main(String[] args) { long Start = 0; long queryTime =
0; try { System.out.println("connecting to Postgres Database .....");
Connection conn = null; Statement stmt = null; Start =
System.currentTimeMillis(); Class.forName("org.postgresql.Driver");
conn = DriverManager
.getConnection("jdbc:postgresql://localhost:5432/events",
"postgres", "sunrise"); stmt = conn.createStatement();
queryTime = System.currentTimeMillis(); ResultSet
rs=stmt.executeQuery("select * from potluck"); while(rs.next())
System.out.println(rs.getString("name")+" "+
rs.getString("food")+" "+ rs.getString("confirmed")+" "+
rs.getString("signup_date")); conn.close(); } catch (Exception e){
System.out.println(e);} long End = System.currentTimeMillis();
System.out.println(" query time taken miiliseconds " + (End - queryTime)
); System.out.println("Connection + query time miiliseconds " + (End
- Start) ); }}*

Browse pgsql-novice by date

  From Date Subject
Next Message Renee 2019-12-16 01:09:41 Re: Hi : Is anybody out there ?
Previous Message Zahid Rahman 2019-12-16 00:04:48 Re: Hi : Is anybody out there ?