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 1eosXS-0001Gs-Hi for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Feb 2018 15:12:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eosXQ-00061c-VA for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Feb 2018 15:12:00 +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 1eosXQ-00061S-OL for pgsql-hackers@lists.postgresql.org; Thu, 22 Feb 2018 15:12:00 +0000 Received: from mail-qt0-f193.google.com ([209.85.216.193]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eosXN-0002z7-AN for pgsql-hackers@postgresql.org; Thu, 22 Feb 2018 15:12:00 +0000 Received: by mail-qt0-f193.google.com with SMTP id d26so6672800qtk.10 for ; Thu, 22 Feb 2018 07:11:56 -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=TMQYG1e+nx+XbYQQNU/Q202JWPpUHvuu12SDDHgCY7o=; b=Wp3gZUd1ftLoYl673lgMneibguknHIAyMMz5JOvxNH/ZJg/8ElQfq6tLZFvy9nh/Xe 0M6pPgqYsdfNVfb2aFpgxOwXqDu5uG173oZsVxjCSCoI1IvI60WvmUf3XbSpoAH4Eby9 ajxqMTPYLfDrqAAcn8vBFY8nuwPcLxv8Gefd2Kvv00WXbUcwdxTd5eyQM93D3wsYgzJH vCwyn51h3Jzy2MR3YfnLSldN6tUi4epVZ44GFAYzKpgllGaGgqpT02U7QMCyJR14YK4Q AnIdFy7eFvQ1G2cWVT9ZFzJo6L1wkea8LE4YT1immFZSNCoi816uVuWVgnJD6C+FJcbs iIqA== X-Gm-Message-State: APf1xPASEFs2bTm0vL1V19cwldQe1JLBXsyUzS3oROEuyFl4hO7Cl8Il Y7Nok9Ua97JXJ9ztAjNDUohvhA== X-Google-Smtp-Source: AH8x226r15uiwEDXroNnDSWlyYg4SqUpzdOagxj5sC+UcpdrF+C4uw1LDdad5xevQr8eD6iy9YVE/A== X-Received: by 10.237.38.2 with SMTP id z2mr11380618qtc.319.1519312314722; Thu, 22 Feb 2018 07:11:54 -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 d74sm193288qka.68.2018.02.22.07.11.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 07:11:54 -0800 (PST) Reply-To: jesper.pedersen@redhat.com Subject: Re: [HACKERS] Runtime Partition Pruning To: David Rowley Cc: Rajkumar Raghuwanshi , Beena Emerson , Alvaro Herrera , Amit Langote , Robert Haas , amul sul , "pgsql-hackers@postgresql.org" , Dilip Kumar References: <20180104163708.bzgheqsny6tsatzf@alvherre.pgsql> From: Jesper Pedersen Organization: Red Hat Message-ID: <99d83db5-d283-5f8b-2970-460889108ede@redhat.com> Date: Thu, 22 Feb 2018 10:11:52 -0500 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 David, On 02/21/2018 04:06 AM, David Rowley wrote: > I've attached v11 of the patch. > Are UPDATE and DELETE suppose to be supported ? With -- test.sql -- CREATE TABLE test (a integer NOT NULL, b integer) PARTITION BY HASH(a); CREATE TABLE test_p00 PARTITION OF test FOR VALUES WITH (MODULUS 2, REMAINDER 0); CREATE TABLE test_p01 PARTITION OF test FOR VALUES WITH (MODULUS 2, REMAINDER 1); CREATE INDEX idx_test_a ON test (a); CREATE INDEX idx_test_b ON test (b); INSERT INTO test (SELECT i,i FROM generate_series(1, 1000000) AS i); ANALYZE; -- test.sql -- and UPDATE test SET b = 1 WHERE a = ? DELETE FROM test WHERE a = ? both shows that all partitions are scanned; Update on test Update on test_p00 Update on test_p01 -> Index Scan using test_p00_a_idx on test_p00 Index Cond: (a = 1) -> Index Scan using test_p01_a_idx on test_p01 Index Cond: (a = 1) Using prune_v32 and runtime_v11 with conflicts resolved. Best regards, Jesper