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 1kfep0-0006vT-E0 for pgsql-general@arkaria.postgresql.org; Thu, 19 Nov 2020 07:57:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kfeoz-0006jS-8z for pgsql-general@arkaria.postgresql.org; Thu, 19 Nov 2020 07:57:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfeoz-0006jL-0k for pgsql-general@lists.postgresql.org; Thu, 19 Nov 2020 07:57:37 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kfeox-0006t8-AX for pgsql-general@lists.postgresql.org; Thu, 19 Nov 2020 07:57:36 +0000 Received: by mail-wm1-x331.google.com with SMTP id c198so4320076wmd.0 for ; Wed, 18 Nov 2020 23:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=IHuGKG0iC+LoRuMRMrRxCmjdulrozeIZ4UJTU5vz/WA=; b=M4oMFDoetqqT7/+dfmS88Cs89EhR2Fz9jwGjM+y0Kc7ASogB6hEey3X8gGGGZw1JzY btsow/MdT+wXsHtIFbymWp1jV2vz0wKbSDx3bwTNn5UPFagWpmRvb9AbHAOoiyqwxUs/ VKbvI9uVCSTgQiylp1mzBKc/l5jTszs0w3jkUTe++Ar/1vNH+1fa2j267C4dysN7Hpr0 9DkqlEKrBSjKKRVQOyt3Lu8E2pjbeRyev+OPmjOFrXvV6q8huJGKG1l5Guu7VaNfQGx3 NA4XUHrtj+XOiFQlcImQoEZuaUBbV2ytcFZ+UKCvd20EZDF2GGVfJcPuIdOnMZZXHAGP RzCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=IHuGKG0iC+LoRuMRMrRxCmjdulrozeIZ4UJTU5vz/WA=; b=R1Jqjb0OwE5AmnnGiiZj8wL/BxFlDLFmU3R1HNau82PjZJRTCqPGuUnR2MrXnkrcoQ L9/yxXHec8gOycXhm9aw+uQGVq9Ub8gNxQOJ1/Mcp9kv0rGygdg2Ev/vyorxVUWBwUkp yThyyN11RImKOZpo6FaL16sBROpW8IY0OP5PH2u4QABmsnKin6aWkI0qp9hXxvA2c8R1 PUw+vgxazmjkUzTGIUAb8GQ+J5eGg3JyixdHn0ytsXznZZ0QNsladKt/MDYbJWpZdfTT 3c0DqvYnD4ib2QMUHAYhrHzgL35bqWHZuUkMfCwbv8o/8+vyIKaDxqty3GSkVcvH762w vvhw== X-Gm-Message-State: AOAM5321PsnJ/ZjiM+INrh2zHcB03Q+EOP9YJyxDEt5dQLGr7eePHtLH e+4gyvMxwZYGd53ZTPM/oYua4X/h77O2Ag== X-Google-Smtp-Source: ABdhPJxpZJyIMhOIBQuvYW6b1Wl8Re38m9xa7IVQki/odFqMu2TkXFgwO7MXXMN65qB3eTMnkEBV7A== X-Received: by 2002:a1c:2803:: with SMTP id o3mr2919219wmo.97.1605772654170; Wed, 18 Nov 2020 23:57:34 -0800 (PST) Received: from localhost.localdomain (62-47-146-92.adsl.highway.telekom.at. [62.47.146.92]) by smtp.gmail.com with ESMTPSA id d134sm8478751wmd.8.2020.11.18.23.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 23:57:33 -0800 (PST) Message-ID: <044d427bf8a91959da6cb20394c166be734afe02.camel@cybertec.at> Subject: Re: \COPY command and indexes in tables From: Laurenz Albe To: Matthias Apitz , pgsql-general@lists.postgresql.org Date: Thu, 19 Nov 2020 08:57:33 +0100 In-Reply-To: <20201119073845.GA13022@r314251-amd64> References: <20201119073845.GA13022@r314251-amd64> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-11-19 at 08:38 +0100, Matthias Apitz wrote: > We load large tables in some customer installation (some millions of rows) > from file with: > > TRUNCATE TABLE tableName ; > \COPY tableName FROM 'fileName' WITH ( DELIMITER '|' ) > > and got to know that the loading nearly stops (without any real CPU > consumption) in the middle. The wild guess is that we forgot to DROP the indexes on > the tables. If it does not consume CPU, it must be stalled somehow. Are there any wait events in "pg_stat_activity". Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com