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 1lD4bt-0002Z8-Bs for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2021 12:10:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lD4bq-0005F1-8C for pgsql-admin@arkaria.postgresql.org; Fri, 19 Feb 2021 12:10:10 +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 1lD4bp-0005Es-VP for pgsql-admin@lists.postgresql.org; Fri, 19 Feb 2021 12:10:10 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lD4bn-00008r-0t for pgsql-admin@lists.postgresql.org; Fri, 19 Feb 2021 12:10:09 +0000 Received: by mail-qk1-x72c.google.com with SMTP id t63so5252375qkc.1 for ; Fri, 19 Feb 2021 04:10:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=LJvD1ri/CIf9C8YUOdzKrt7wfj0e0nv1J+d+LzLdtS4=; b=E9k8pfmTLLH+BSZ28aXtUggKEF8oD4Z1NLtcwmMRyLX/jC7gO7iFP1kd1mjDlctwV7 r3znZVIIiZuPwt4iQYBYTjiItc8OozxlP4rrljSCDyLnBFXUTTjggVCdvep8LfVydbzG Us8/7FcneVo93HYDAFOEQ8/2kY1gHALs4I4h7i81HFjNPEAqDVxa/uwMRh5VeuF6t4q8 GcE9gLezGwtjdvFzxlMYcTgs8O11/n5YwIRd3jzHzGTvMuLCck8A8MABz4riQ074mOxt QiZDdZkhl4bQ6wdBzUaaqy/1dvjOsl+EraXFEoRnKGjNGUa3nx1kpi1zbFRZVK8WvLNy oEgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=LJvD1ri/CIf9C8YUOdzKrt7wfj0e0nv1J+d+LzLdtS4=; b=bzkJIdnwZeBpqGwLrxgNgFrig6Lm/eivtqWykru1bZ1n986iNXB2CYZQd7aIBpmjkr yWYimq/EcnTj0wOFzGB6WbottVUtWwGbI3FjrwUwN1ZRlGBPvSfMjvakPu1wM+MmYqNo ruEmzswEcrhMRPzs+Q8ZNSAo7huiCSr1e8PJfZrwcUr9iQXlBjLCLM01/JRu+dLLta7I zVC0Pc0GRgoBvVSfcBaAVVOAZ+RQr0psOhuxqZiDRUHbsRrAKEx9F6pvgpZQCz7V+4WI upqufctI6kcYOqK6GO1VScuSy+VkTNd+yVjRS32P26R7etnEQNFLH4HCsznX8vT/Nwb8 Gd6Q== X-Gm-Message-State: AOAM532NlJq2pH8fXCN83J075X0zW7F1YjBcu4HgUzXLMAIUeeQicyCA ubN4XiDkfiwh7/ukPt/o7YQ= X-Google-Smtp-Source: ABdhPJz8enoPSMh0Q51kqjj3mNn2Fy09Arjxg5pByR04iBmp71GwaUgndGdtJGZUclBRP3E4rkWoWQ== X-Received: by 2002:a37:6f06:: with SMTP id k6mr9096912qkc.458.1613736605132; Fri, 19 Feb 2021 04:10:05 -0800 (PST) Received: from [192.168.254.67] (h178.165.133.40.static.ip.windstream.net. [40.133.165.178]) by smtp.gmail.com with ESMTPSA id 83sm2720392qkn.123.2021.02.19.04.10.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Feb 2021 04:10:04 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: John Scalia Mime-Version: 1.0 (1.0) Subject: Re: Disabling indexes on a table Date: Fri, 19 Feb 2021 07:10:03 -0500 Message-Id: <81BF8164-61B9-4C51-A592-714FA270A6A6@gmail.com> References: <66028fd5cc301f5726d759e46903f88f8c18217f.camel@cybertec.at> Cc: Pgsql-admin In-Reply-To: <66028fd5cc301f5726d759e46903f88f8c18217f.camel@cybertec.at> To: Laurenz Albe X-Mailer: iPad Mail (18D52) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank you for the confirmation Laurenz, I suspected this would be the situat= ion, and the developer did drop the indexes prior loading then rebuilt them a= fterwards per my suggestion. Sent from my iPad > On Feb 19, 2021, at 4:23 AM, Laurenz Albe wrote= : >=20 > =EF=BB=BFOn Thu, 2021-02-18 at 11:24 -0500, John Scalia wrote: >> One of my developers asked me about this, and he suggested running the fo= llowing update: >>=20 >> UPDATE pg_index SET indisready=3Dfalse >> WHERE indrelid =3D (select oid from pg_class where release =3D =E2=80=98h= is_table=E2=80=99); >>=20 >> I told him it=E2=80=99s never a good idea to update anything in a system c= atalog by hand, >> but that I would reach out here for a better opinion. Am I correct that h= e >> shouldn=E2=80=99t try this, or is he OK to do this? His table has approxi= mately 8 >> different indexes on it, and those really slow down his bulk loads. >> Usually when I have to get involved, I just drop his indexes and rebuild >> them afterwards, and I know that is always safe. >=20 > https://www.postgresql.org/docs/current/catalog-pg-index.html says: >=20 > indisready bool >=20 > If true, the index is currently ready for inserts. False means the > index must be ignored by INSERT/UPDATE operations. >=20 > So that would indeed speed up a bulk load, but your indexes would be > unusable afterwards. If you run a second update to "pg_index" to > set "indisready" to TRUE, you would end up with corrupted indexes. >=20 > The indexes will be useless and can only be dropped. So you are right > that that is not a good idea. >=20 > Yours, > Laurenz Albe > --=20 > Cybertec | https://www.cybertec-postgresql.com >=20