Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0qLl-0002WW-LF for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Mar 2019 16:21:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h0qKl-0003Vq-Ol for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Mar 2019 16:20:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0qKl-0003TR-Df for pgsql-hackers@lists.postgresql.org; Mon, 04 Mar 2019 16:20:55 +0000 Received: from mail-qt1-f194.google.com ([209.85.160.194]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0qKi-0008Ks-2M for pgsql-hackers@postgresql.org; Mon, 04 Mar 2019 16:20:54 +0000 Received: by mail-qt1-f194.google.com with SMTP id o6so5719440qtk.6 for ; Mon, 04 Mar 2019 08:20:51 -0800 (PST) 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=wKw6e4JK6f+6a6sImwkEQdmPoOq5e4vz5kx1webeqXA=; b=fGu1ns5INcBmWCEaTAfd5RimqnPdcBhoHIXB0wZ9QS2joAylbXh4iHM05HYa0EfR2o 2/nxouEAIOZIyudo+b7WDChBX2jVjV4dx0IjL7pSyblBmxwnW4kH20lcnSCcetks5aBX W2c+SKaQWleTAMXx07sfKQbBDbBhOL2NHhoA//I0itcViHqkenTDY+gZz69dxC5jh8+c hhE4fwcaZI2rfMg4Kw0dKTS+1yUzsJ4aMFeUVhwh9Ht2EVywosDS/1CjjO8gHBeh4/Pk IO3bQ7b2dRJnO8Ds2YI5Q8qT8g1m0+z7SLnFmYShrFqqLyX2ZwopvW8DoRqXf4zfr7EX UkTQ== X-Gm-Message-State: APjAAAVyQeQycael9ZNUjA4qFNk+pI6AI/HqBz3RGiuUIBWkatEoEZEn Unf79mE19UiBV+a3SdcRkSOkJaQsWvA= X-Google-Smtp-Source: APXvYqyV+dzXANpO+i3DKv/mkf7DKrU9rI3P0aDn7bpbyZdkINLvtkozDa/FK1PPxd5AlZEvflwUWA== X-Received: by 2002:a0c:fb10:: with SMTP id c16mr14939425qvp.187.1551716450737; Mon, 04 Mar 2019 08:20:50 -0800 (PST) Received: from localhost.localdomain (c-24-61-8-151.hsd1.ma.comcast.net. [24.61.8.151]) by smtp.gmail.com with ESMTPSA id h26sm4150073qtk.52.2019.03.04.08.20.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 08:20:49 -0800 (PST) Reply-To: jesper.pedersen@redhat.com Subject: Re: speeding up planning with partitions To: Amit Langote Cc: "Imai, Yoshikazu" , 'Amit Langote' , Tom Lane , David Rowley , Alvaro Herrera , Justin Pryzby , Pg Hackers References: <7453.1550518972@sss.pgh.pa.us> <0a70234e-b2e6-debc-2fb5-e8fd927caa00@lab.ntt.co.jp> <1002.1550596071@sss.pgh.pa.us> <30961.1550609873@sss.pgh.pa.us> <250c61bc-479c-92f4-d19d-d768e3bcdcbc@lab.ntt.co.jp> <13510.1550677844@sss.pgh.pa.us> <35b02675-83c2-a12b-961a-fec249b06f35@lab.ntt.co.jp> <20190222165932.GG28750@telsasoft.com> <0F97FA9ABBDBE54F91744A9B37151A51293422@g01jpexmbkw24> <8098beec-fc04-303d-55b9-73c3d94ba1ea@lab.ntt.co.jp> From: Jesper Pedersen Organization: Red Hat Message-ID: Date: Mon, 4 Mar 2019 11:20:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 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 Amit, Passes check-world. On 3/4/19 5:38 AM, Amit Langote wrote: > See patch 0001. > +* members of any appendrels we find here are added built later when s/built// > See patch 0002. > + grouping_planner(root, false, 0.0 /* retrieve all tuples */); Move comment out of function call. + if (root->simple_rte_array[childRTindex]) + elog(ERROR, "rel %d already exists", childRTindex); + root->simple_rte_array[childRTindex] = childrte; + if (root->append_rel_array[childRTindex]) + elog(ERROR, "child relation %d already exists", childRTindex); + root->append_rel_array[childRTindex] = appinfo; Could the "if"s be made into Assert's instead ? + * the newly added bytes with zero Extra spaces + if (rte->rtekind == RTE_RELATION && !root->contains_inherit_children) s/TAB/space > See patch 0003. > + * because they correspond to flattneed UNION ALL subqueries. Especially, s/flattneed/flatten > See patch 0004. > + * no need to make any new entries, because anything that'd need those Use "would" explicit + * this case, since it needn't be scanned. , since it doesn't need to be scanned > See patch 0005. > > See patch 0006. > I'll run some tests using a hash partitioned setup. Best regards, Jesper