Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQVzD-0003pg-LA for pgsql-performance@arkaria.postgresql.org; Fri, 22 Jul 2016 08:39:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bQVzD-00018B-3K for pgsql-performance@arkaria.postgresql.org; Fri, 22 Jul 2016 08:39:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bQVxX-0007d1-Uh for pgsql-performance@postgresql.org; Fri, 22 Jul 2016 08:37:28 +0000 Received: from mail-it0-x232.google.com ([2607:f8b0:4001:c0b::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bQVxU-0006rN-75 for pgsql-performance@postgresql.org; Fri, 22 Jul 2016 08:37:27 +0000 Received: by mail-it0-x232.google.com with SMTP id u186so32546504ita.0 for ; Fri, 22 Jul 2016 01:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=B3qJY7V/N07Kl3KspZzi7SOqI2eNUsDHsqnaWftCYd8=; b=r41Lx8akCNaitU0zG+VY+Zhj2+UBZRoUMU2GJPH6FSrt0jwVsqltf4n9F2PHkSVZJF Gmp38yqkCY9w5aeW78u3O5r9b8OB+FUKiF9+OaZB6EBiKyYSzgs4NJZT79FvydxRrwE6 Wy+pNaBWPtJOK+SgSymqYCdfzZHI/BAewoNlgDts0QXlbNTNGMn/PA+1HoE2T/zODSTJ vSMo2K9gdMpSKGkcI4jqLJ20gN9+SOSOxeVYKgYb1q2npQzfRoOasYic9CTOji6BlwEl yZCscMn5EST9bABnspPaJPzuaZSeWivnrPMjUZPCuH/zsSYXlrLDY/0iZVL++P7eaqfh Fjng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=B3qJY7V/N07Kl3KspZzi7SOqI2eNUsDHsqnaWftCYd8=; b=WJVW0zc/wvmu8pSb80+1769p7ScDjEUs8tZyU3VLx0TvOjT5QM63Qt07cZCHyVRTa8 ZqMqq33bTJ5z19noJiryq9K7DHCuopNkfvDH6DEiJXecXOVrdBjQi/FTN68j9jV7izaH ALvokMkFMikxYuoehPzDKMeEBHULWbRuw5Fp/dLXU4W2jiOCfp+QacAjygrYsLTU59xf Kpl5iIHKZRFHOfVpbFxoW0Ttko3fz4YfqDx33JoP06K7Kn53GGHB+I/D8IQT/Xz2dRfl oocVR3DqszrVxu0Ue4HDHQh0oCkGO4RA+CQ0fqqRkUhVv7uGdPe+EREWnvV6d6wl5sHG FWUg== X-Gm-Message-State: ALyK8tKp17Sh7BqEzGrjtsKzuwc+CxMM5/3JEAB33cCNFEreTPtsrsu0bdLLhxuOFXsENsm0ahRIptkpG+n4GQ== X-Received: by 10.36.104.85 with SMTP id v82mr66244665itb.64.1469176641665; Fri, 22 Jul 2016 01:37:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.142.138 with HTTP; Fri, 22 Jul 2016 01:37:20 -0700 (PDT) In-Reply-To: <1e196503-3b9b-b16b-22a2-9e080faa4007@BlueTreble.com> References: <4b2f737a-ea37-35cd-012b-307ee1c9a584@BlueTreble.com> <11766.1468959038@sss.pgh.pa.us> <15306.1469138384@sss.pgh.pa.us> <1e196503-3b9b-b16b-22a2-9e080faa4007@BlueTreble.com> From: Robert Klemme Date: Fri, 22 Jul 2016 10:37:20 +0200 Message-ID: Subject: Re: Seeing execution plan of foreign key constraint check? To: Jim Nasby Cc: Tom Lane , pgsql-performance Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On Fri, Jul 22, 2016 at 12:14 AM, Jim Nasby wrote: > On 7/21/16 4:59 PM, Tom Lane wrote: >>> >>> > As for function plans, ISTM that could be added to the PL handlers if >>> > we >>> > wanted to (allow a function invocation to return an array of explain >>> > outputs). >> >> Where would you put those, particularly for functions executed many >> times in the query? Would it include sub-functions recursively? >> I mean, yeah, in principle we could do something roughly like that, >> but it's not easy and presenting the results intelligibly seems >> almost impossible. > > > Yeah, it'd certainly need to be handled internally in a > machine-understandable form that got aggregated before presentation (or with > non-text output formats we could provide the raw data). Or just punt and > don't capture the data unless you're using an alternative output format. I'd imagine the output to just list all "recursive" execution plans executed probably along with indicators for how much IO and / or CPU they were responsible for. The "recursive" plans could also be sorted in decreasing order of total (i.e. across all individual invocations) time spent so you see the most impacting plan first. All of that would loose displaying calling relationships at the advantage of a simpler presentation. I think, the relationship which statement / function invoked with other could be determined by looking at statements / functions. And I guess often it will be apparent from names already. I am wondering what to do if the same statement has multiple execution plans if that is possible in such a scenario. Present all the plans or just the one with the highest impact? Show them next to each other so the user is immediately aware that all these plans originated from the same piece of SQL? Kind regards robert -- [guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can - without end} http://blog.rubybestpractices.com/ -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance