Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k7oxK-0001D6-DV for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Aug 2020 23:54:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k7oxI-0007Sa-7w for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Aug 2020 23:54:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k7oxI-0007ST-0r for pgsql-hackers@lists.postgresql.org; Mon, 17 Aug 2020 23:54:20 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k7oxF-00036a-11 for pgsql-hackers@postgresql.org; Mon, 17 Aug 2020 23:54:18 +0000 Received: by mail-qk1-x741.google.com with SMTP id b79so16688316qkg.9 for ; Mon, 17 Aug 2020 16:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Ov2cikjWRJzxnwrgWhf0pYOoDaZdRR2797b4kx9ku/U=; b=oe1y2036RWaeBZiX/MNXwHsDeJpHqibHiYWxlWFF9GvyMJPRsk29oahMALE6eL8dwk iyYyoayhLUHu0PrhlzdqIuQbXI1lGylb9PSB0tJhT6XDvexof0EA9GSYG1tLhMP3GOg0 BJlfxzO3aS60W8rk2FpGLuPgBhpRauodqS1UyZgfEojyENBI4dQlalOMD27dAx1kOJI3 Ui1VUUBC6miAjmm+eX+IOnT0V5T88k4eCfZp/xXdmtNUgG5mKYP3hdGfHyObFtPW1lLW iBX6lEVzw8EiggFufcm35jprkrmH1En+17m68jLcwq89Y/n8YBisB+9PBGKNJS+NZ57i DgIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Ov2cikjWRJzxnwrgWhf0pYOoDaZdRR2797b4kx9ku/U=; b=elwUoluraY0i8WAI/jG1j2CRhtp957mz2O40At12uQTRhf9lOQ4vo66elC9enparOb CfkB2J54arHDQhNCX3PHmeH4CW70BE/9gIvz3gWG4dnVIyqFpN4kncGqTDz7FYsT+iyE nnKoT8oP1W9ovaU+zmijpEyyy1RL2e+a2Wv+0Mrs59cjyrO9JsTS6SpI+izSjX9z3beB MjexpUL0bktDALFYfUhgmR7A6RLNiksMGhwk7Fwu04GiFeiW0kB6qph5xvegDKMW7P/9 gWEth8EkNUPyDSOaS9Q0U5/SM2/tGXkeHKooOItRvF3aK4WQy6xeBH8yk20O9xgU+PVc AnGg== X-Gm-Message-State: AOAM533pGJmI1ms82vcaduhg71Oo3DLyq9bQXkNNiWXk3SJmGg0FdmCN AB2ov7vezY0+zmw3C3rmMiTClQ== X-Google-Smtp-Source: ABdhPJyez/u0RAWmyjxHbwgj/Q2+UvnWP2a4WEB5XzSJj7Orn/hXRKu4m2YkJMWqAQk9tEx5KpSPyg== X-Received: by 2002:a05:620a:2ee:: with SMTP id a14mr14989042qko.42.1597708456107; Mon, 17 Aug 2020 16:54:16 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id u8sm9559356qkj.9.2020.08.17.16.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 16:54:15 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9A7412A0FC3; Mon, 17 Aug 2020 19:54:13 -0400 (-04) Date: Mon, 17 Aug 2020 19:54:13 -0400 From: Alvaro Herrera To: Ibrar Ahmed Cc: Anastasia Lubennikova , Robert Haas , Daniel Gustafsson , Justin Pryzby , pgsql-hackers , Andres Freund Subject: Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits Message-ID: <20200817235413.GA11940@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Aug-14, Ibrar Ahmed wrote: > The table used for the test contains three columns (integer, text, > varchar). > The total number of rows is 10000000 in total. > > Unpatched (Master: 92c12e46d5f1e25fc85608a6d6a19b8f5ea02600) > COPY: 9069.432 ms vacuum; 2567.961ms > COPY: 9004.533 ms vacuum: 2553.075ms > COPY: 8832.422 ms vacuum: 2540.742ms > > Patched (Master: 92c12e46d5f1e25fc85608a6d6a19b8f5ea02600) > COPY: 10031.723 ms vacuum: 127.524 ms > COPY: 9985.109 ms vacuum: 39.953 ms > COPY: 9283.373 ms vacuum: 37.137 ms > > Time to take the copy slightly increased but the vacuum time significantly > decrease. "Slightly"? It seems quite a large performance drop to me -- more than 10%. Where is that time being spent? Andres said in [1] that he thought the performance shouldn't be affected noticeably, but this doesn't seem to hold true. As I understand, the idea was that there would be little or no additional WAL records .. only flags in the existing record. So what is happening? [1] https://postgr.es/m/20190408010427.4l63qr7h2fjcyp77@alap3.anarazel.de Also, when Andres posted this patch first, he said this was only for heap_multi_insert because it was a prototype. But I think we expect that the table_insert path (CIM_SINGLE mode in copy) should also receive that treatment. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services