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 1goUL3-0008Ad-TM for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jan 2019 14:26:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1goUL2-0002iA-Fz for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Jan 2019 14:26:08 +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 1goUL2-0002i3-33 for pgsql-hackers@lists.postgresql.org; Tue, 29 Jan 2019 14:26:08 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goUKy-0004Ui-PS for pgsql-hackers@lists.postgresql.org; Tue, 29 Jan 2019 14:26:06 +0000 Received: by mail-wm1-x342.google.com with SMTP id b11so18080466wmj.1 for ; Tue, 29 Jan 2019 06:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RIKZM8xrmcXkFkzcYZv/Ug2Ee1Xq/w6ZYcCNKXPpcYw=; b=kAUZfVa9ly6pEvdDSrOTcqtsnffbRhFSXVEEbtfn/ii1wO3f6L2VFjnCrwCQ3qkuF4 4T77S//hHW8NTaTuh9JECVh1VAyiuXtLZMfKnRAvohK2wJ7WG86I/wu22eD6i5cSNTOk dkDsKAS7PUJyCF7XOeFK0J9YuCjKbvi5f68BXzXOMI6OKwsA4GsU8gccHzXW1kexGoXn jP/SahyHGrqxDFP5FQdIv/LfbPoFr4uPiBHN9k7BuGySE9lkBuFInBYVEJ4FBB8dSjTa O8QDTNu/u+wKrubXCiMbB6Rin4Tc4vfz7e1RxqbeccRMTZELnLcAUqfk6uGV3QKK5kTj RkKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RIKZM8xrmcXkFkzcYZv/Ug2Ee1Xq/w6ZYcCNKXPpcYw=; b=mafp36zj1vcviM6C0YnX4G9tTHDpAA26HvDFoMrHu5Zo/2r3rjIvVAWEiR7ytqOKYi 14v1AmYRPh4b83OVGLfPpL1pRVEjuYu0uAEiCkH982To+CF9wMSjgBoWTkUN/204nCba 2tzDXkbR2D+CX6C061CgGTCadJKu+l/blBt/gXn5YAoW6SlDQRL5SJolt0MCOIb6mtcp ZRa8SHpnZRWY9RFNsU0VRBA06QY3JHywTjTzQ0ap/iP1oH+Cw3tjIOVmdFs4WLBwJ4FX PO3CKQ3FLKJemX3SNXk2WOoZ/sX/HrzYkQH554k+GWrGAAq4zmO5WfAlKI6Fe6l2KMdy EXTg== X-Gm-Message-State: AJcUuker/v9dNK7L11dk9BLdQIBZmfzFdHSxAwEFiqLEanJ0q/vLPizE iwncN0UslCXzJd+gG2zdSkmPPE7BsNFdZBidINJSGfMUrEWyxwf9BmLQGiyDBTOKf35HgS0bNoe ba38A3jwebikWlX972iI2B0spn7NvbHz5UH5xM+o5y0B5T8XacK+Mt47IgS6eJK0ERNZl7D6Opl FqIoRlQglBZ6ZqYhB/PR0= X-Google-Smtp-Source: ALg8bN5NN68VjMDSyNDel+TXjPjUws0a+1C7i091TEfE3q3u1paLv88i3IXf97CBcf6r+HYM7tQx4w== X-Received: by 2002:a1c:dc86:: with SMTP id t128mr22564853wmg.42.1548771962723; Tue, 29 Jan 2019 06:26:02 -0800 (PST) Received: from [10.137.2.21] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id z206sm4587770wmc.18.2019.01.29.06.26.01 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 06:26:01 -0800 (PST) Subject: Re: COPY FROM WHEN condition To: David Rowley Cc: Andres Freund , Surafel Temesgen , Alvaro Herrera , Adam Berlin , PostgreSQL Hackers References: <3b2b1aac-5861-acd8-fda3-054c4e4da888@2ndquadrant.com> <20190121012405.633row4iw7nfxz7h@alap3.anarazel.de> <6e80b7c1-58cd-4212-41d3-7c519aed0500@2ndquadrant.com> <20190121020805.3kdscvwzwvijlees@alap3.anarazel.de> <20190121021220.7tbu3oizvydov5by@alap3.anarazel.de> <52b10375-aca3-ea9b-10a1-2e4e9a011665@2ndquadrant.com> <20190121185102.m7keci23l7q6byou@alap3.anarazel.de> <0a3d8cff-0b9d-ea2e-634b-5dcb8d0d5766@2ndquadrant.com> From: Tomas Vondra Message-ID: Date: Tue, 29 Jan 2019 15:25:59 +0100 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 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/29/19 8:18 AM, David Rowley wrote: > ... > Here are my performance tests of with and without your change to the > memory contexts (I missed where you posted your results). > > $ cat bench.pl > for (my $i=0; $i < 8912891; $i++) { > print "1\n1\n2\n2\n"; > } > 36a1281f86c: (with your change) > > postgres=# copy listp from program $$perl ~/bench.pl$$ delimiter '|'; > COPY 35651564 > Time: 26825.142 ms (00:26.825) > Time: 27202.117 ms (00:27.202) > Time: 26266.705 ms (00:26.267) > > 4be058fe9ec: (before your change) > > postgres=# copy listp from program $$perl ~/bench.pl$$ delimiter '|'; > COPY 35651564 > Time: 25645.460 ms (00:25.645) > Time: 25698.193 ms (00:25.698) > Time: 25737.251 ms (00:25.737) > How do I reproduce this? I don't see this test in the thread you linked, so I'm not sure how many partitions you were using, what's the structure of the table etc. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services