pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Time of executed query
10+ messages / 4 participants
[nested] [flat]

* Time of executed query
@ 2007-03-06 13:20  Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  0 siblings, 4 replies; 10+ messages in thread

From: Ezequias Rodrigues da Rocha @ 2007-03-06 13:20 UTC (permalink / raw)
  To: pgsql-sql; Pgadmin-Support <pgadmin-support@postgresql.org>

Hi list,

It is possible to retrieve the time of a SQL statement leads to
execute ? I would like to put in my application how much time each
operation leads to finish.

Any suggestion ?

-- 
Ezequias Rodrigues da Rocha
http://ezequiasrocha.blogspot.com/
use Mozilla Firefox:http://br.mozdev.org/firefox/



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Time of executed query
@ 2007-03-06 13:26  Bart Degryse <Bart.Degryse@indicator.be>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  3 siblings, 1 reply; 10+ messages in thread

From: Bart Degryse @ 2007-03-06 13:26 UTC (permalink / raw)
  To: pgsql-sql; +Cc: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>

note the time just before your operation starts
note the time just after it ends
show timeafter - timebefore

>>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com> 2007-03-06 14:20 >>>
Hi list,

It is possible to retrieve the time of a SQL statement leads to
execute ? I would like to put in my application how much time each
operation leads to finish.

Any suggestion ?

-- 
Ezequias Rodrigues da Rocha
http://ezequiasrocha.blogspot.com/ 
use Mozilla Firefox:http://br.mozdev.org/firefox/

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Time of executed query
@ 2007-03-06 13:37  Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  parent: Bart Degryse <Bart.Degryse@indicator.be>
  0 siblings, 1 reply; 10+ messages in thread

From: Ezequias Rodrigues da Rocha @ 2007-03-06 13:37 UTC (permalink / raw)
  To: Bart Degryse <Bart.Degryse@indicator.be>; +Cc: pgsql-sql

I preffer that the database give me this information. I don't know if
it is possible becouse if we retrieve many rows and if we want to put
this result in a new column the same time will be replicated many
times and consuming more processing.

Any other suggestion ?
Ezequias

2007/3/6, Bart Degryse <Bart.Degryse@indicator.be>:
>
>
> note the time just before your operation starts
> note the time just after it ends
> show timeafter - timebefore
>
> >>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com> 2007-03-06
> 14:20 >>>
>
> Hi list,
>
> It is possible to retrieve the time of a SQL statement leads to
> execute ? I would like to put in my application how much time each
> operation leads to finish.
>
> Any suggestion ?
>
> --
> Ezequias Rodrigues da Rocha
> http://ezequiasrocha.blogspot.com/
> use Mozilla Firefox:http://br.mozdev.org/firefox/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>


-- 
Ezequias Rodrigues da Rocha
http://ezequiasrocha.blogspot.com/
use Mozilla Firefox:http://br.mozdev.org/firefox/



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Time of executed query
@ 2007-03-06 13:43  Shoaib Mir <shoaibmir@gmail.com>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  0 siblings, 1 reply; 10+ messages in thread

From: Shoaib Mir @ 2007-03-06 13:43 UTC (permalink / raw)
  To: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>; +Cc: Bart Degryse <Bart.Degryse@indicator.be>; pgsql-sql

Did you try EXPLAIN ANALYZE <SQL Query>?

---
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 3/6/07, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
>
> I preffer that the database give me this information. I don't know if
> it is possible becouse if we retrieve many rows and if we want to put
> this result in a new column the same time will be replicated many
> times and consuming more processing.
>
> Any other suggestion ?
> Ezequias
>
> 2007/3/6, Bart Degryse <Bart.Degryse@indicator.be>:
> >
> >
> > note the time just before your operation starts
> > note the time just after it ends
> > show timeafter - timebefore
> >
> > >>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com> 2007-03-06
> > 14:20 >>>
> >
> > Hi list,
> >
> > It is possible to retrieve the time of a SQL statement leads to
> > execute ? I would like to put in my application how much time each
> > operation leads to finish.
> >
> > Any suggestion ?
> >
> > --
> > Ezequias Rodrigues da Rocha
> > http://ezequiasrocha.blogspot.com/
> > use Mozilla Firefox:http://br.mozdev.org/firefox/
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
> >
>
>
> --
> Ezequias Rodrigues da Rocha
> http://ezequiasrocha.blogspot.com/
> use Mozilla Firefox:http://br.mozdev.org/firefox/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Time of executed query
@ 2007-03-06 13:45  Bart Degryse <Bart.Degryse@indicator.be>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  3 siblings, 0 replies; 10+ messages in thread

From: Bart Degryse @ 2007-03-06 13:45 UTC (permalink / raw)
  To: pgsql-sql; +Cc: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>

Assuming you're using stored procedures...
Start procedure with logging current time, name of procedure,...
Perform whatever must be performed
End procedure with logging current time, name of procedure,...
Query logging table to get time spent
 
Alternative, still assuming you're using stored procedures...
Start procedure with noting current time, name of procedure,...
Perform whatever must be performed
End procedure with logging current time - start time, name of procedure,...
Query logging table to get time spent


>>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com> 2007-03-06 14:37 >>>
I preffer that the database give me this information. I don't know if
it is possible becouse if we retrieve many rows and if we want to put
this result in a new column the same time will be replicated many
times and consuming more processing.

Any other suggestion ?
Ezequias

2007/3/6, Bart Degryse <Bart.Degryse@indicator.be>:
>
>
> note the time just before your operation starts
> note the time just after it ends
> show timeafter - timebefore
>
> >>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com> 2007-03-06
> 14:20 >>>
>
> Hi list,
>
> It is possible to retrieve the time of a SQL statement leads to
> execute ? I would like to put in my application how much time each
> operation leads to finish.
>
> Any suggestion ?
>
> --
> Ezequias Rodrigues da Rocha
> http://ezequiasrocha.blogspot.com/ 
> use Mozilla Firefox:http://br.mozdev.org/firefox/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>


-- 
Ezequias Rodrigues da Rocha
http://ezequiasrocha.blogspot.com/ 
use Mozilla Firefox:http://br.mozdev.org/firefox/

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [SQL] Time of executed query
@ 2007-03-06 13:55  Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  parent: Shoaib Mir <shoaibmir@gmail.com>
  0 siblings, 2 replies; 10+ messages in thread

From: Ezequias Rodrigues da Rocha @ 2007-03-06 13:55 UTC (permalink / raw)
  To: Shoaib Mir <shoaibmir@gmail.com>; +Cc: Bart Degryse <Bart.Degryse@indicator.be>; pgsql-sql; Pgadmin-Support <pgadmin-support@postgresql.org>

EXPLAIN ANALYZE Is perfect but i have no idea of how to use it. My
resultset is retrieving my rows.

Another question that cames with the Analyze. PgAdmin return the time
to retrieve the data or all time to fill the grid on the "SQL Editor".

-- 
Ezequias Rodrigues da Rocha
http://ezequiasrocha.blogspot.com/
use Mozilla Firefox:http://br.mozdev.org/firefox/


2007/3/6, Shoaib Mir <shoaibmir@gmail.com>:
> Did you try EXPLAIN ANALYZE <SQL Query>?
>
> ---
> Shoaib Mir
> EnterpriseDB (www.enterprisedb.com)
>
>
> On 3/6/07, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
> > I preffer that the database give me this information. I don't know if
> > it is possible becouse if we retrieve many rows and if we want to put
> > this result in a new column the same time will be replicated many
> > times and consuming more processing.
> >
> > Any other suggestion ?
> > Ezequias
> >
> > 2007/3/6, Bart Degryse <Bart.Degryse@indicator.be>:
> > >
> > >
> > > note the time just before your operation starts
> > > note the time just after it ends
> > > show timeafter - timebefore
> > >
> > > >>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com > 2007-03-06
> > > 14:20 >>>
> > >
> > > Hi list,
> > >
> > > It is possible to retrieve the time of a SQL statement leads to
> > > execute ? I would like to put in my application how much time each
> > > operation leads to finish.
> > >
> > > Any suggestion ?
> > >
> > > --
> > > Ezequias Rodrigues da Rocha
> > > http://ezequiasrocha.blogspot.com/
> > > use Mozilla Firefox: http://br.mozdev.org/firefox/
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 5: don't forget to increase your free space map settings
> > >
> >
> >
> > --
> > Ezequias Rodrigues da Rocha
> > http://ezequiasrocha.blogspot.com/
> > use Mozilla Firefox:http://br.mozdev.org/firefox/
> >
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
> >
>
>



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [SQL] Time of executed query
@ 2007-03-06 13:59  Shoaib Mir <shoaibmir@gmail.com>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Shoaib Mir @ 2007-03-06 13:59 UTC (permalink / raw)
  To: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>; +Cc: Bart Degryse <Bart.Degryse@indicator.be>; pgsql-sql; Pgadmin-Support <pgadmin-support@postgresql.org>

EXPLAIN ANALYZE does give the query execution time at the end of its output.

--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 3/6/07, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
>
> EXPLAIN ANALYZE Is perfect but i have no idea of how to use it. My
> resultset is retrieving my rows.
>
> Another question that cames with the Analyze. PgAdmin return the time
> to retrieve the data or all time to fill the grid on the "SQL Editor".
>
> --
> Ezequias Rodrigues da Rocha
> http://ezequiasrocha.blogspot.com/
> use Mozilla Firefox:http://br.mozdev.org/firefox/
>
>
> 2007/3/6, Shoaib Mir <shoaibmir@gmail.com>:
> > Did you try EXPLAIN ANALYZE <SQL Query>?
> >
> > ---
> > Shoaib Mir
> > EnterpriseDB (www.enterprisedb.com)
> >
> >
> > On 3/6/07, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
> > > I preffer that the database give me this information. I don't know if
> > > it is possible becouse if we retrieve many rows and if we want to put
> > > this result in a new column the same time will be replicated many
> > > times and consuming more processing.
> > >
> > > Any other suggestion ?
> > > Ezequias
> > >
> > > 2007/3/6, Bart Degryse <Bart.Degryse@indicator.be>:
> > > >
> > > >
> > > > note the time just before your operation starts
> > > > note the time just after it ends
> > > > show timeafter - timebefore
> > > >
> > > > >>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com >
> 2007-03-06
> > > > 14:20 >>>
> > > >
> > > > Hi list,
> > > >
> > > > It is possible to retrieve the time of a SQL statement leads to
> > > > execute ? I would like to put in my application how much time each
> > > > operation leads to finish.
> > > >
> > > > Any suggestion ?
> > > >
> > > > --
> > > > Ezequias Rodrigues da Rocha
> > > > http://ezequiasrocha.blogspot.com/
> > > > use Mozilla Firefox: http://br.mozdev.org/firefox/
> > > >
> > > > ---------------------------(end of
> > > > broadcast)---------------------------
> > > > TIP 5: don't forget to increase your free space map settings
> > > >
> > >
> > >
> > > --
> > > Ezequias Rodrigues da Rocha
> > > http://ezequiasrocha.blogspot.com/
> > > use Mozilla Firefox:http://br.mozdev.org/firefox/
> > >
> > > ---------------------------(end of
> > broadcast)---------------------------
> > > TIP 5: don't forget to increase your free space map settings
> > >
> >
> >
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: Time of executed query
@ 2007-03-06 14:01  Bart Degryse <Bart.Degryse@indicator.be>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Bart Degryse @ 2007-03-06 14:01 UTC (permalink / raw)
  To: pgsql-sql; +Cc: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>

EXPLAIN ANALYZE is only for tuning purposes.
Read the manual (http://www.postgresql.org/docs/8.1/interactive/sql-explain.html) to get more insight

>>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com> 2007-03-06 14:55 >>>
EXPLAIN ANALYZE Is perfect but i have no idea of how to use it. My
resultset is retrieving my rows.

Another question that cames with the Analyze. PgAdmin return the time
to retrieve the data or all time to fill the grid on the "SQL Editor".

-- 
Ezequias Rodrigues da Rocha
http://ezequiasrocha.blogspot.com/ 
use Mozilla Firefox:http://br.mozdev.org/firefox/


2007/3/6, Shoaib Mir <shoaibmir@gmail.com>:
> Did you try EXPLAIN ANALYZE <SQL Query>?
>
> ---
> Shoaib Mir
> EnterpriseDB (www.enterprisedb.com)
>
>
> On 3/6/07, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
> > I preffer that the database give me this information. I don't know if
> > it is possible becouse if we retrieve many rows and if we want to put
> > this result in a new column the same time will be replicated many
> > times and consuming more processing.
> >
> > Any other suggestion ?
> > Ezequias
> >
> > 2007/3/6, Bart Degryse <Bart.Degryse@indicator.be>:
> > >
> > >
> > > note the time just before your operation starts
> > > note the time just after it ends
> > > show timeafter - timebefore
> > >
> > > >>> "Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com > 2007-03-06
> > > 14:20 >>>
> > >
> > > Hi list,
> > >
> > > It is possible to retrieve the time of a SQL statement leads to
> > > execute ? I would like to put in my application how much time each
> > > operation leads to finish.
> > >
> > > Any suggestion ?
> > >
> > > --
> > > Ezequias Rodrigues da Rocha
> > > http://ezequiasrocha.blogspot.com/ 
> > > use Mozilla Firefox: http://br.mozdev.org/firefox/ 
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 5: don't forget to increase your free space map settings
> > >
> >
> >
> > --
> > Ezequias Rodrigues da Rocha
> > http://ezequiasrocha.blogspot.com/ 
> > use Mozilla Firefox:http://br.mozdev.org/firefox/
> >
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 5: don't forget to increase your free space map settings
> >
>
>

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [SQL] Time of executed query
@ 2007-03-06 15:37  Rodrigo De León <rdeleonp@gmail.com>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  3 siblings, 0 replies; 10+ messages in thread

From: Rodrigo De León @ 2007-03-06 15:37 UTC (permalink / raw)
  To: pgsql-sql; Pgadmin-Support <pgadmin-support@postgresql.org>

On 3/6/07, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
> Hi list,
>
> It is possible to retrieve the time of a SQL statement leads to
> execute ? I would like to put in my application how much time each
> operation leads to finish.
>
> Any suggestion ?
>
> --
> Ezequias Rodrigues da Rocha
> http://ezequiasrocha.blogspot.com/
> use Mozilla Firefox:http://br.mozdev.org/firefox/

Use psql:

t=# \timing
t=# SELECT * FROM generate_series(1,100000) WHERE random() = 0.234;
 generate_series
-----------------
(0 rows)

Time: 125.000 ms
t=#

See:

http://www.postgresql.org/docs/8.2/static/app-psql.html



^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [SQL] Time of executed query
@ 2007-03-06 15:39  Rodrigo De León <rdeleonp@gmail.com>
  parent: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  3 siblings, 0 replies; 10+ messages in thread

From: Rodrigo De León @ 2007-03-06 15:39 UTC (permalink / raw)
  To: pgsql-sql; Pgadmin-Support <pgadmin-support@postgresql.org>

On 3/6/07, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
> Hi list,
>
> It is possible to retrieve the time of a SQL statement leads to
> execute ? I would like to put in my application how much time each
> operation leads to finish.
>
> Any suggestion ?
>
> --
> Ezequias Rodrigues da Rocha
> http://ezequiasrocha.blogspot.com/
> use Mozilla Firefox:http://br.mozdev.org/firefox/

Sorry, didn't see the app part.

Use clock_timestamp().

See:

http://www.postgresql.org/docs/8.2/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT



^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2007-03-06 15:39 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-06 13:20 Time of executed query Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2007-03-06 13:26 ` Bart Degryse <Bart.Degryse@indicator.be>
2007-03-06 13:37   ` Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2007-03-06 13:43     ` Shoaib Mir <shoaibmir@gmail.com>
2007-03-06 13:55       ` Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2007-03-06 13:59         ` Shoaib Mir <shoaibmir@gmail.com>
2007-03-06 14:01         ` Bart Degryse <Bart.Degryse@indicator.be>
2007-03-06 13:45 ` Bart Degryse <Bart.Degryse@indicator.be>
2007-03-06 15:37 ` Rodrigo De León <rdeleonp@gmail.com>
2007-03-06 15:39 ` Rodrigo De León <rdeleonp@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox