Database query execution times in Python?

Discussion in 'Python' started by pwnedd, Aug 7, 2009.

  1. pwnedd

    pwnedd Guest

    Hi all,

    I've been writing some code using libraries based on the Python Database API
    2.0 (MySQLdb & pg), and so far things are working really well. There is one
    thing that I have not been able to figure out how to do, however:

    Retrieve the time is took a given query to execute.

    Does anyone know if this is possible?

    Any help would be greatly appreciated.

    Thanks!
    Keith


    --
    View this message in context: http://www.nabble.com/Database-query-execution-times-in-Python--tp24870050p24870050.html
    Sent from the Python - python-list mailing list archive at Nabble.com.
    pwnedd, Aug 7, 2009
    #1
    1. Advertising

  2. pwnedd

    Aahz Guest

    In article <>,
    pwnedd <> wrote:
    >
    >I've been writing some code using libraries based on the Python Database API
    >2.0 (MySQLdb & pg), and so far things are working really well. There is one
    >thing that I have not been able to figure out how to do, however:
    >
    >Retrieve the time is took a given query to execute.


    Look up EXPLAIN
    --
    Aahz () <*> http://www.pythoncraft.com/

    "...string iteration isn't about treating strings as sequences of strings,
    it's about treating strings as sequences of characters. The fact that
    characters are also strings is the reason we have problems, but characters
    are strings for other good reasons." --Aahz
    Aahz, Aug 13, 2009
    #2
    1. Advertising

  3. pwnedd

    Aahz Guest

    In article <>,
    pwnedd <> wrote:
    >
    >> Look up EXPLAIN

    >
    >Thanks for the suggestion. I don't see any option to have EXPLAIN display
    >the query time though?


    My suggestion was partly a gentle push toward a database forum to get
    more information -- this isn't really a Python question. Unless all you
    want to do is get the wall-clock time, in which case just use
    time.time().
    --
    Aahz () <*> http://www.pythoncraft.com/

    "Given that C++ has pointers and typecasts, it's really hard to have a
    serious conversation about type safety with a C++ programmer and keep a
    straight face. It's kind of like having a guy who juggles chainsaws
    wearing body armor arguing with a guy who juggles rubber chickens wearing
    a T-shirt about who's in more danger." --Roy Smith
    Aahz, Aug 19, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWF2cmlja18xMDE=?=

    SetAuthCookie works some times and fails some times?

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 23, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    500
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 23, 2006
  2. =?Utf-8?B?bWF2cmlja18xMDE=?=

    Forms Authentication Fails some times and not some times???

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 28, 2006
  3. djskrill
    Replies:
    9
    Views:
    689
    djskrill
    Oct 1, 2003
  4. Peng Yu
    Replies:
    17
    Views:
    676
    Peng Yu
    Sep 14, 2008
  5. Jack Steven
    Replies:
    2
    Views:
    418
    Chris Rebert
    Mar 9, 2009
Loading...

Share This Page