Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 37E0AFE0757 for ; Fri, 30 Dec 2011 21:15:53 -0400 (AST) Received: from mail-iy0-f174.google.com ([209.85.210.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RgnY8-0004O3-5l for pgsql-performance@postgresql.org; Sat, 31 Dec 2011 01:15:52 +0000 Received: by iaeh11 with SMTP id h11so26074992iae.19 for ; Fri, 30 Dec 2011 17:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=tuIIQUuC9B0dlLaQHNA1Dr8IS+ieJVQlKnEqUIg1bl0=; b=OtNe+zUU+bhrBTEO6YbsR/FTvHw8f01DaUSNtJ0+gB5M2tGaIA9tgGxjm4FD0VsFLc 1iTo6JXE+KtE+mn/4+xJ/twouaE9sSH09NGj8J5AzUNG0vUGF9pwGVqpya9EuBqn1vaz LxuZM6eQlp0fDvByXqQoYQqY3TIWPo3KQT6fo= Received: by 10.50.188.132 with SMTP id ga4mr57296391igc.4.1325294139772; Fri, 30 Dec 2011 17:15:39 -0800 (PST) Received: from [10.235.197.127] (39.sub-174-253-236.myvzw.com. [174.253.236.39]) by mx.google.com with ESMTPS id wp7sm67132631igc.6.2011.12.30.17.15.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Dec 2011 17:15:38 -0800 (PST) References: In-Reply-To: Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: Cc: "pgsql-performance@postgresql.org" X-Mailer: iPhone Mail (9A405) From: Igor Subject: Re: How to clock the time spent for query parsing and planning? Date: Fri, 30 Dec 2011 16:59:57 -0800 To: Pavel Stehule X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201112/214 X-Sequence-Number: 46013 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 opti= mization algorithms.=20 Pls let me know if my understanding is not correct. In that case, how do I f= ind out how much of query time is spent to prepare the query and how much ti= me is spent executing it.=20 Thanks, James On Dec 27, 2011, at 1:38 AM, Pavel Stehule wrote: > Hello >=20 > 2011/12/23 Igor Schtein : >> I'd like to find some measurements/figures of query preparation and plann= ing >> 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? >=20 > You can use time for EXPLAIN statement >=20 > Regards >=20 > Pavel Stehule >=20 >>=20 >> Thank you, >> James