Unix Technical Forum

Re: Time of executed query

This is a discussion on Re: Time of executed query within the pgsql Sql forums, part of the PostgreSQL category; --> note the time just before your operation starts note the time just after it ends show timeafter - timebefore ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Sql

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 03:10 PM
Bart Degryse
 
Posts: n/a
Default Re: Time of executed query

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 03:10 PM
Ezequias Rodrigues da Rocha
 
Posts: n/a
Default Re: Time of executed query

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 03:10 PM
Shoaib Mir
 
Posts: n/a
Default Re: Time of executed query

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
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 03:10 PM
Bart Degryse
 
Posts: n/a
Default Re: Time of executed query

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/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 03:10 PM
Bart Degryse
 
Posts: n/a
Default Re: Time of executed query

EXPLAIN ANALYZE is only for tuning purposes.
Read the manual (http://www.postgresql.org/docs/8.1/i...-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
> >

>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-19-2008, 03:10 PM
Shoaib Mir
 
Posts: n/a
Default Re: Time of executed query

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

> >
> >

>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:15 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com