Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4oJS-0000oV-VT for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Apr 2018 13:55:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f4oJR-0004B3-8U for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Apr 2018 13:55:25 +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.89) (envelope-from ) id 1f4oJQ-0004As-UO for pgsql-hackers@lists.postgresql.org; Sat, 07 Apr 2018 13:55:25 +0000 Received: from mail-qk0-f196.google.com ([209.85.220.196]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f4oJN-0004KU-Qt for pgsql-hackers@postgresql.org; Sat, 07 Apr 2018 13:55:23 +0000 Received: by mail-qk0-f196.google.com with SMTP id w6so4260864qkb.4 for ; Sat, 07 Apr 2018 06:55:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=AgbfkyoeaV278bG/ciY/jk4RvmCEyMGrRG96dcPTknw=; b=T3XNZQVVYfTNo0wjvMizDUsDL6CSosMnPkPqWqSpZvxkNDMtwv9b5sdJ3vTy9UDCvZ CbXbzAONynGfu1luNGUAyOymZeZMJI7zSpbou7S78Mn/7XXYA0NWC6xxvclBuZfbFJ15 bavQdELkTVjidb//mDXuP75laRIr8QeU4H5P38S21XgF7ModpB8a2AF+47NVVBclxMvq N1EDBYhfjnG1XZ5k5bh1cURaN4zdC08cK1SEEE9IxaNXfPRAzrL3Iwn1BdWKyaCB1Und aJpWueeT3zALHRFmo7rEgjVneiU/9YSAh2AWRmKlkIkIAn89zbITx1Ox1UYB2I1DlW0P WYWQ== X-Gm-Message-State: AElRT7EqNakEr4vx1Pub/DyCBKt8F02nvqO17SAcoV0DwB5CRng47YCe bxTWZrVrcBq4gOcJu+JWImyUMQ== X-Google-Smtp-Source: AIpwx4/eoblfVFrBv7ps7t6tKT+XCgI6ihKuipGMJG5koAt92jwRmZQ8GH7RP64pO48uKgJEtI3sRg== X-Received: by 10.55.167.23 with SMTP id q23mr41268262qke.329.1523109320745; Sat, 07 Apr 2018 06:55:20 -0700 (PDT) Received: from localhost.localdomain (c-24-61-8-151.hsd1.ma.comcast.net. [24.61.8.151]) by smtp.gmail.com with ESMTPSA id c29sm10647033qtb.75.2018.04.07.06.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Apr 2018 06:55:19 -0700 (PDT) Reply-To: jesper.pedersen@redhat.com Subject: Re: [HACKERS] Runtime Partition Pruning To: David Rowley , Amit Langote Cc: Alvaro Herrera , Amit Langote , Rajkumar Raghuwanshi , Beena Emerson , Robert Haas , amul sul , "pgsql-hackers@postgresql.org" , Dilip Kumar References: <20180406212507.6ddl76zkhd2ze4p5@alvherre.pgsql> <20180406212917.zzq5dbmasyt3fwru@alvherre.pgsql> From: Jesper Pedersen Organization: Red Hat Message-ID: <308e5f60-cf13-bf1e-73bc-4e40f5128baf@redhat.com> Date: Sat, 7 Apr 2018 09:55:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 04/07/2018 04:45 AM, David Rowley wrote: > Ok, so I've gone and done this. > > PartitionPruning has become PartitionPruneState > PartitionRelPruning has become PartitionPruningData > > I've changed pointers to PartitionPruneStates to be named prunestate, > sometimes having the node prefix; as_, ma_, in these cases prune and > state are separated with a _ which seems to be the general rule for > executor state struct members. > > Generally, pointers to PartitionPruningData are now named pprune. > Hopefully, that's ok, as this was the name previously used for > PartitionPruning pointers. > > I applied the patch to get rid of as_noop_scan in favour of using a > special as_whichplan value. There was already one special value > (INVALID_SUBPLAN_INDEX), so seemed better to build on that rather than > inventing something new. This also means we don't have to make the > AppendState struct and wider too, which seems like a good thing to try > to do. > > I made all the fixups which I mentioned in my review earlier and also > re-removed the resultRelation parameter from make_partition_pruneinfo. > It sneaked back into v22. > > v23 is attached. > Passes check-world. Changing explain.c to "Subplans Removed" as suggested by you in [1] is a good idea. [1] https://www.postgresql.org/message-id/CAKJS1f99JnkbOshdV_4zoJZ96DPtKeHMHv43JRL_ZdHRkkVKCA%40mail.gmail.com Best regards, Jesper