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 1szIU9-005K3X-3V for pgsql-general@arkaria.postgresql.org; Fri, 11 Oct 2024 16:27:25 +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 1szIU6-007PiU-CE for pgsql-general@arkaria.postgresql.org; Fri, 11 Oct 2024 16:27:22 +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 1szIU6-007PiF-0z for pgsql-general@lists.postgresql.org; Fri, 11 Oct 2024 16:27:22 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1szIU3-000ONA-Sa for pgsql-general@postgresql.org; Fri, 11 Oct 2024 16:27:21 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5398df2c871so3053830e87.1 for ; Fri, 11 Oct 2024 09:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728664038; x=1729268838; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ajXPhDT1YnHNYr2Wvxr5FHFK0Ln2sCbBNFdpZyJDXcM=; b=HoSYuhaDZhCoBwm5ZALLyt+n8hCEbEMEQRoKpmsFrX4ngfOu1hfZ5FuEpNRjCKzbTY lwy3gpOF9VusplCLs8BXDq+b5lhcKlVkXCzfdcU8/Pamkbdfvw/Ax/O1pyt74E1Fm14/ 9ZVMDxq1mY18HIFxMfsWp9Uhi5w2zsvjUVUQwPIwRmzscqgcd/G5mr4eI0zVVXweH5/e kIO5v6coAKrKU+AiaUYdMqSaGg6KLkr4Nu818KVjsbYH2x6bp7o5G0U91aAy1rKLKtk0 vgykkRqY7GvUSBPqJHFbxJbUADsScPF2ZXX20LUcqaWvaVmEG9P3Fn6SOKz+0JajHuii I3Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728664038; x=1729268838; h=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=ajXPhDT1YnHNYr2Wvxr5FHFK0Ln2sCbBNFdpZyJDXcM=; b=vYV/ddGiuyD9PpY0YN+7EOcRwMD5INZhpor6zWjQoHYHE9FCxrOxljWHw6/2GdrjcM 3Nf2mNGFrU7uifVNUwqbDu91R8Ijje9I59jFBFrx+XnBiiLRqXG91FVn1PhDCcY5FNY+ 8bAyp/Um11NoHEFDC9HBF+87+3q2DbvhT8NSL8C5NneW70/JYYIFi2rxQNIb6AGOPUsO zJ2mFrbW48fS0RbjEz4JB6yhTDCYVcUkigL+79dyDZpO67EFKNnwHgLj4aRQ42nmIVV4 EqdQrn/LCYGTVGqh55CxFgGufJuRrHNqFBGkMZhs6NsFrxkTdUxz2dkO4f6AEL+7C5Mk u7YQ== X-Gm-Message-State: AOJu0Yy/gwyVqsu00FgcSyhP8+QTcwL9mxdKObal1UfoNK4FKSFt7ITE +shz03etGP0j2KJTOfjT2WR4kuAocoL3IYGzf18/INVh66+OWEhD2q1nRzdL9iPyZrbzodjFEv4 4S0Wq87S32JUrRucSab2y8Fu/I9w= X-Google-Smtp-Source: AGHT+IF6GHY/QxweiYx6hsmFawbOdB0EdIbEzpr0UZVjUgCTyVNjj4+fdpoYNkYkN7G6YjHvFAQmLzP8nzuLYO0mM6o= X-Received: by 2002:a05:6512:b1f:b0:531:4c6d:b8ef with SMTP id 2adb3069b0e04-539da3b43efmr1944459e87.6.1728664037735; Fri, 11 Oct 2024 09:27:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Greg Sabino Mullane Date: Fri, 11 Oct 2024 12:26:40 -0400 Message-ID: Subject: Re: Inefficient use of index scan on 2nd column of composite index during concurrent activity To: Durgamahesh Manne Cc: PostgreSQL mailing lists Content-Type: multipart/alternative; boundary="000000000000e7c98c062435f5fd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e7c98c062435f5fd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 11, 2024 at 9:28=E2=80=AFAM Durgamahesh Manne wrote: > composite key (placedon,id) > In concurrent mode if i use id at where clause then query plan for that i= d > column changes > > How to mitigate it rather than use seperate index for id to continue > without change in query plan (index scan) during concurrent activity > Why the focus on "concurrent mode"? Perhaps explain what you mean by that. Speaking of explain, it might help if you show us the explain plans and how they are not coming out how you want. Also the table definitions, but feel free to not show columns unrelated to the problem. Cheers, Greg --000000000000e7c98c062435f5fd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Oct 11, 2024 at 9:28=E2=80=AFAM D= urgamahesh Manne <maheshpos= tgres9@gmail.com> wrote:
composite key (placedo= n,id)=C2=A0
In concurrent mode if i use id at where clause th= en query plan for that id column changes=C2=A0

How= to mitigate it rather than use seperate index for id to continue without c= hange in query plan (index scan) during concurrent activity=C2=A0

Why the focus on "= ;concurrent mode"? Perhaps explain what you mean by that.
Speaking of explain, it might help if you show us the explain = plans and how they are not coming out how you want. Also the table definiti= ons, but feel free to not show columns unrelated to the problem.
=
Cheers,
Greg

--000000000000e7c98c062435f5fd--