Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqrkg-00BKlz-7t for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Mar 2025 10:49:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tqrkd-00FAws-RN for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Mar 2025 10:49:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqrkd-00FAwk-Gw for pgsql-hackers@lists.postgresql.org; Sat, 08 Mar 2025 10:49:51 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tqrkb-001f3t-27 for pgsql-hackers@lists.postgresql.org; Sat, 08 Mar 2025 10:49:50 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5e6167d0536so1117498a12.1 for ; Sat, 08 Mar 2025 02:49:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741430988; x=1742035788; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Gj40OmNNWztpyrq/LI//dImNzVtWWK72GpFsdNr8jXc=; b=VfBMvm6k8CXezmS42f2r0K4zaySCM7qF7YWizdZ9+EIkdILqUts8I3J2UDrbiTFvkh pEg6WRlDTt4bM9Gj3xMOiLsCgOliUHvdcqBejLJycfRDV+pU40OrRAnyo7VAnx+iUeU5 yANPAGU0MbevPwO/BUcbwM4ZKWqvl56qOGqim4NUCeKufqyt189Sx11l+mdIhBjo1c/L 1eASqnnDyYZmE9OQu1ocF0DKGQuUgZzN6IxL051do4cf0c5eAeUzHZPljNuiRNeMyZIi I7CsxDaI+eS6qoKOdF8gKT/VG25+YcgCXveNgF7Lh4DnhPFyOTV10yJDJSKBZIRfRlIJ M6UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741430988; x=1742035788; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gj40OmNNWztpyrq/LI//dImNzVtWWK72GpFsdNr8jXc=; b=NqYwE4AzCLS1BVUlWpqqiNrQT4Uqsk4tv0Cc8GcOu5LV8G/D4feJNVQzVQRVvZGKn8 rxsAndRYhFDrxAxwtOQud3bogoJFaGTgrjQI+vxWTw0Ex+7Ih8VoM67ep+wXicDPtnNO NY6pLsFUzayOgyTwAEuMRIBvvnQZXyUNCQ5tdczYPUNn4rnI4FBTPQbBTAO6EOg1rsNy +8L6EEzDLqnkDnI7Yi6VhdaIitP/FQlP/NjxOt9IPltqnvOErP5Xv86EG5UU7jrCtbsq ANWRyMYO4ieOXTggpQb/MK8pSLeVMIZBn7OPNpHi5r4Tn7xNYz3w5nL0/sCOU7BQfGPC aA7Q== X-Forwarded-Encrypted: i=1; AJvYcCWUQjvUp0StqZc+6ErNaDAGNHF/7J9kZ/9S1DnBmlFGgfW0CWMRoeUs/idRZDRm84MQay0Ohoj0+8hyLNwP@lists.postgresql.org X-Gm-Message-State: AOJu0Yy6B79zcoNQiF0QCyZTtoFwf/F6fhA9o7bmPYTwF44h1K7yeH1O qw3MsYZ3BmaQ8f3SuwRhmyje3xsCHrOoBN1z4lcMv6kDqFcXJfNseU0gvAYNgn//DhcJkB4EHi/ tmyWV1MptIk3GUVTkfTidYiNWOFI= X-Gm-Gg: ASbGncv6FBRNJEizNLAc6L0T8d5xmTCOTU/pDpviXgwC1FgfpQsmxajb3eonSZ5SXQb 5M3RTpmBxPBgORrC4BZaNl397D6iRQFJirVEavIj9W1bYRdLUMqyfj5UTBsGZ15lRcmGmu3LdSz mUGchaRNPlssgcPWlZE2unWbTqVA== X-Google-Smtp-Source: AGHT+IHdozRM56hyDUBngDhsSAOdtwuZAWG0LUfCJocZYgRLhVOhtkU49DAJ99AIMaR3BYsgwe74aimnhPtp6LJ9S0w= X-Received: by 2002:a17:907:1b05:b0:abf:5759:7aa9 with SMTP id a640c23a62f3a-ac252737ce9mr768705366b.7.1741430986799; Sat, 08 Mar 2025 02:49:46 -0800 (PST) MIME-Version: 1.0 References: <202503071820.j25zn3lo4hvn@alvherre.pgsql> In-Reply-To: <202503071820.j25zn3lo4hvn@alvherre.pgsql> From: Alexander Korotkov Date: Sat, 8 Mar 2025 12:49:35 +0200 X-Gm-Features: AQ5f1JovzaG_iWLjIU1BMec4chdgptxRxl9XKs6DqS89_0y8QnQDGNhqDzkcpDc Message-ID: Subject: Re: pgsql: reindexdb: Add the index-level REINDEX with multiple jobs To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Alexander Korotkov , pgsql-hackers@lists.postgresql.org, Maxim Orlov , Svetlana Derevyanko Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 7, 2025 at 8:20=E2=80=AFPM =C3=81lvaro Herrera wrote: > > On 2024-Mar-25, Alexander Korotkov wrote: > > > reindexdb: Add the index-level REINDEX with multiple jobs > > > > Straight-forward index-level REINDEX is not supported with multiple job= s as > > we cannot control the concurrent processing of multiple indexes dependi= ng on > > the same relation. Instead, we dedicate the whole table to certain rei= ndex > > job. Thus, if indexes in the lists belong to different tables, that gi= ves us > > a fair level of parallelism. > > I tested this, because of a refactoring suggestion [1] and I find that > it's rather completely broken. The code was written with assumption that running run_reindex_command() with async =3D=3D true can schedule a number of queries for a connection. But actually that's not true and everything is broken. ------ Regards, Alexander Korotkov Supabase