Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8u4e-0006IC-H4 for pgsql-hackers@arkaria.postgresql.org; Thu, 11 May 2017 19:48:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d8u4e-00014u-3z for pgsql-hackers@arkaria.postgresql.org; Thu, 11 May 2017 19:48:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d8u4d-00014U-CK for pgsql-hackers@postgresql.org; Thu, 11 May 2017 19:48:31 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8u4a-0000O8-Gj for pgsql-hackers@postgresql.org; Thu, 11 May 2017 19:48:30 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 9588421C2ABC; Thu, 11 May 2017 22:48:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Message-ID: <5914C00A.9030908@postgrespro.ru> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1494532107; bh=w3TLsaG2NRzuI6oIQxJ30TjSLNLnmbvsQ4eCJwTKLx4=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=JNe7ROtP4FIDHI0DLW+QpMOBJkQOTHyOtkCUxUEGyeS1aHpfBs7Zbeb9nI8+to1wY 7u+Bg10aNAd0qAo3OHlJv1nA/Tet7zTZdip9HubdMqKDQmA0GqGnG35rb/RlJx1DcO j0ObkccnzvuFrBGI7Svce1VBz55f80V2s/ZAT0+U= Date: Thu, 11 May 2017 22:48:26 +0300 From: Konstantin Knizhnik User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Tom Lane , Bruce Momjian CC: Douglas Doole , Robert Haas , Pavel Stehule , PostgreSQL Hackers , Andres Freund Subject: Re: Cached plans and statement generalization References: <7741e358-ff0e-af5d-9899-306b20a1a6e1@postgrespro.ru> <304dfa09-6135-cbcf-d6e5-1ea6c36e6eec@postgrespro.ru> <4bd78cd4-1e64-5294-2eb8-3d061b20288f@postgrespro.ru> <8eed9c23-19ba-5404-7a9e-0584b836b3f3@postgrespro.ru> <20170511151233.GE17200@momjian.us> <20170511181505.GA25894@momjian.us> <22696.1494527462@sss.pgh.pa.us> In-Reply-To: <22696.1494527462@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 05/11/2017 09:31 PM, Tom Lane wrote: > Bruce Momjian writes: >> Good point. I think we need to do some measurements to see if the >> parser-only stage is actually significant. I have a hunch that >> commercial databases have much heavier parsers than we do. > FWIW, gram.y does show up as significant in many of the profiles I take. > I speculate that this is not so much that it eats many CPU cycles, as that > the constant tables are so large as to incur lots of cache misses. scan.l > is not quite as big a deal for some reason, even though it's also large. > > regards, tom lane Yes, my results shows that pg_parse_query adds not so much overhead: 206k TPS for my first variant with string literal substitution and modified query text used as hash key vs. 181k. TPS for version with patching raw parse tree constructed by pg_parse_query. -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers