Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbKD8-0003ZK-By for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Oct 2021 10:13:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mbKCa-0006DA-KU for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Oct 2021 10:12:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbKCa-0006D1-Bt for pgsql-hackers@lists.postgresql.org; Fri, 15 Oct 2021 10:12:36 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbKCX-0005ev-6F for pgsql-hackers@lists.postgresql.org; Fri, 15 Oct 2021 10:12:36 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 62A8E611B6; Fri, 15 Oct 2021 19:12:26 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 15 Oct 2021 19:12:26 +0900 From: torikoshia To: Ekaterina Sokolova Cc: pgsql-hackers@lists.postgresql.org Subject: Re: RFC: Logging plan of the running query In-Reply-To: <33455325d4bc6ec5a04f8cd2d460fdb9@oss.nttdata.com> References: <0842b5da697a03869fb50be93817e4e1@oss.nttdata.com> <1c1590d3962cea6e06621da76677b5f3@oss.nttdata.com> <64f716c44629e303b66e6c24502147cc@oss.nttdata.com> <8b53b32f-26cc-0531-4ac0-27310e0bef4b@oss.nttdata.com> <7958d03fffe3bafcfe8a505145c63928@oss.nttdata.com> <9c4d9da6-48a5-fa18-4bff-f8eb0d4c9787@oss.nttdata.com> <59e6df324b41176d319f9c30bdb1d858@oss.nttdata.com> <0642712f-1298-960a-a3ba-e256d56040ac@oss.nttdata.com> <3d345c49561f31a1d8ff60ea86f88840@oss.nttdata.com> <33455325d4bc6ec5a04f8cd2d460fdb9@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <41d139f1b377500ad0295cb9a10e8969@oss.nttdata.com> X-Sender: torikoshia@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-10-15 15:17, torikoshia wrote: > I only took a quick look at pg_query_state, I have some questions. > > pg_query_state seems using shm_mq to expose the plan information, but > there was a discussion that this kind of architecture would be tricky > to do properly [1]. > Does pg_query_state handle difficulties listed on the discussion? Sorry, I forgot to add the URL. [1] https://www.postgresql.org/message-id/9a50371e15e741e295accabc72a41df1%40oss.nttdata.com > It seems the caller of the pg_query_state() has to wait until the > target process pushes the plan information into shared memory, can it > lead to deadlock situations? > I came up with this question because when trying to make a view for > memory contexts of other backends, we encountered deadlock situations. > After all, we gave up view design and adopted sending signal and > logging. Discussion at the following URL. https://www.postgresql.org/message-id/9a50371e15e741e295accabc72a41df1%40oss.nttdata.com Regards, -- Atsushi Torikoshi NTT DATA CORPORATION