How to clock the time spent for query parsing and planning?

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

How to clock the time spent for query parsing and planning?

От:
Igor Schtein <ischtein@gmail.com>
Дата:
I'd like to find some measurements/figures of query preparation and planning time to justify the use of prepared statements and stored procedures.
I know that complex queries have larger preparation time. Though, is it possible to explicitly measure the time the optimizer spends parsing and planning for query execution?

Thank you,
James

Re: How to clock the time spent for query parsing and planning?

От:
Pavel Stehule <pavel.stehule@gmail.com>
Дата:
Hello

2011/12/23 Igor Schtein :
> I'd like to find some measurements/figures of query preparation and planning
> time to justify the use of prepared statements and stored procedures.
> I know that complex queries have larger preparation time. Though, is it
> possible to explicitly measure the time the optimizer spends parsing and
> planning for query execution?

You can use time for EXPLAIN statement

Regards

Pavel Stehule

>
> Thank you,
> James

Re: How to clock the time spent for query parsing and planning?

От:
Pavel Stehule <pavel.stehule@gmail.com>
Дата:
2011/12/31 Igor :
> Hi Pavel,
>
> Thanks for your reply.
>
> My understanding is that Explain provides measurements of query run time but does not include or specifies the timing for  planning and for running optimization algorithms.

the a result of explain is visualisation of execution plan - so all
necessary steps (parsing, analysing, optimization) was processed. So
time of EXPLAIN is time that you looking. Other similar value should
by time of PREPARE statement.

Regards

Pavel

>
> Pls let me know if my understanding is not  correct. In that case, how do I find out how much of query time is spent to prepare the query and how much time is spent executing it.
>
> Thanks,
> James
>
> On Dec 27, 2011, at 1:38 AM, Pavel Stehule  wrote:
>
>> Hello
>>
>> 2011/12/23 Igor Schtein :
>>> I'd like to find some measurements/figures of query preparation and planning
>>> time to justify the use of prepared statements and stored procedures.
>>> I know that complex queries have larger preparation time. Though, is it
>>> possible to explicitly measure the time the optimizer spends parsing and
>>> planning for query execution?
>>
>> You can use time for EXPLAIN statement
>>
>> Regards
>>
>> Pavel Stehule
>>
>>>
>>> Thank you,
>>> James

Re: How to clock the time spent for query parsing and planning?

От:
Igor <ischtein@gmail.com>
Дата:
Hi Pavel,

Thanks for your reply.

My understanding is that Explain provides measurements of query run time but does not include or specifies the timing for  planning and for running optimization algorithms. 

Pls let me know if my understanding is not  correct. In that case, how do I find out how much of query time is spent to prepare the query and how much time is spent executing it. 

Thanks,
James

On Dec 27, 2011, at 1:38 AM, Pavel Stehule  wrote:

> Hello
> 
> 2011/12/23 Igor Schtein :
>> I'd like to find some measurements/figures of query preparation and planning
>> time to justify the use of prepared statements and stored procedures.
>> I know that complex queries have larger preparation time. Though, is it
>> possible to explicitly measure the time the optimizer spends parsing and
>> planning for query execution?
> 
> You can use time for EXPLAIN statement
> 
> Regards
> 
> Pavel Stehule
> 
>> 
>> Thank you,
>> James
FAQ