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 1kmYQM-00054G-Lg for pgsql-admin@arkaria.postgresql.org; Tue, 08 Dec 2020 08:32:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kmYQL-0006b2-KA for pgsql-admin@arkaria.postgresql.org; Tue, 08 Dec 2020 08:32:41 +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 1kmYQL-0006av-DA for pgsql-admin@lists.postgresql.org; Tue, 08 Dec 2020 08:32:41 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kmYQK-0007Ds-38 for pgsql-admin@lists.postgresql.org; Tue, 08 Dec 2020 08:32:41 +0000 Received: by mail-oi1-x22b.google.com with SMTP id f132so4160597oib.12 for ; Tue, 08 Dec 2020 00:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=6Wfyf4RaGzZYhm0sNHmpG1I49pdV8YH0AAPqm8XtQ7Q=; b=MKRW8Hv5MXN4mfgakADrTIp4Z3Et6lANTVs8pYoYT3UDsc0UKXZK9YbdZ+GNp6lw5w jqjPrVP8vScNOAAFGIlEAuZlOEK9xzkF3akojt2uHk6/2wbIOO1+aehRpgavmnxpBbbR m6d1iIxW7ay2M8gok2g/W33XB07tIj84gmHByKJeQ2fkCDBWm2g163xTZ8q6byWx59oE 0DLdyJEj0X8pY3ICvfWh3tPMfADeZJUq4h1qW8FYNeNJBFXxDr86vzWzK9sj5KoCoxYa 06QtfcVMFXiWSjYURUSEmjpFD4zRiaEQwGSjFORmoYiJ57lETQMexbJfI1msVZQTs5Wg BeRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6Wfyf4RaGzZYhm0sNHmpG1I49pdV8YH0AAPqm8XtQ7Q=; b=hOUoA4KeOetLJUiau74BsBd1NDY2IWuXuH3ms0V1HsoVjbqbuF9rB49xq6ekxg8iYy RIdp7bfZITqr1BOS60tl2RJSuC+8HvGHZAlxMBTyf9X7V8O1/6L0VmGYPawcSd6s3/dD ushHAl1lg+XtAp4K4d6owwg7884HUYEx6ZzypZQ1v7bIeJqTrMvBHnb3dnVLT5+J4wfs 65nfNKvIZvgyvRe0LGkCv+YZP4uvxdznDHGONIqBfP0xIw0gA3rY2mHddjJpHs6aURt/ MJgpL0p2XH3WkehQ6tk7bCfSeGMCBlKegId6932SFhaYxYvOlh7C92hjY4uZXGjPHMYx OVYg== X-Gm-Message-State: AOAM533TyZkOWBzfkHYqIxsCg40QF21d8Pk65H04l0p1HtSyuRz7V8Hh q9lXcwYVa+hTMYhwmnq9xOu5sRp5wqWGMQ== X-Google-Smtp-Source: ABdhPJxv/zVHKwtRSzkWCt4u9SXaXUqVWUwc4Riui4BGK0znGwDAV0LblrNqVPqrIxGCiCpKNoeFAQ== X-Received: by 2002:aca:cf4a:: with SMTP id f71mr1929774oig.157.1607416358305; Tue, 08 Dec 2020 00:32:38 -0800 (PST) Received: from [192.168.1.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id e81sm3561027oia.30.2020.12.08.00.32.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Dec 2020 00:32:37 -0800 (PST) Subject: Re: reindexing db To: pgsql-admin@lists.postgresql.org References: <292966DF-135C-4483-81A9-5027FC3C8A82@elevated-dev.com> <214E5DBC-1F6F-49C1-8B83-9A2EB33E969A@gmail.com> <39a8cdb5-bfbb-9ae8-5867-c4234373277c@gmail.com> <98c19d44-8d4c-f608-5432-eef048965552@gmail.com> <01FAC841-0FF0-4B63-A507-C76EFB62A97F@gmail.com> From: Ron Message-ID: <5cd1d643-b205-57cb-dd80-7054ffb0facc@gmail.com> Date: Tue, 8 Dec 2020 02:32:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <01FAC841-0FF0-4B63-A507-C76EFB62A97F@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/8/20 1:46 AM, Paul Förster wrote: > Hi Ron, > >> On 08. Dec, 2020, at 08:42, Ron wrote: >> >> DB=test >> while read line; >> do >> psql $DB "REINDEX TABLE $line CONCURRENTLY;" >> done < list_of_tables.txt > yes, you can do that of course. In this case, I would add an "&" after the psql and probably a "wait" at the end. This should get the job done in parallel. :-) > > That of course depends on how fast the machine is and how much load it can take. :-) The purpose of GNU Parallels is to not flood a system.  Adding the "--jobs=" feature to reindexdb (along with enumerating tables using "--tables") would serve the same purpose. -- Angular momentum makes the world go 'round.