Обсуждение: Timing queries

Поиск
Список
Период
Сортировка

Timing queries

От
Adriaan Joubert
Дата:
Hi,

    I've got a large application with hundreds of different queries. I
thought I had them all sorted out (i.e. determined the correct indices
to make them quick), but now I see that, with 5 copies of the
application running, I'm getting some serious contention on the
database. Is there some way of switching on debugging, so that I can see
the query that is executed and get an elapsed+system time for its
execution (elapsed to figure out whether it may be hanging on locks,
better still would be information on how long a query was locked out)?
From the debugging the framework for something like this seems to exist,
and I found a section in chapter 62 of the developer's guide that says
something about timing, but couldn't figure out exactly what.

I'm using 4.2 and a mix of perl/DBI/DBD and C++/libpq.

Thanks,

Adriaan