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 1sfxF5-00Deck-2M for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2024 07:55:55 +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 1sfxF2-00GxtV-QL for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2024 07:55:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sfxF2-00GxtN-FS for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2024 07:55:53 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sfxEz-000PBe-Lu for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2024 07:55:52 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-52f025bc147so4836472e87.3 for ; Mon, 19 Aug 2024 00:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724054150; x=1724658950; darn=lists.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=DFFP4yJko/fGjAhwqndZxir06xKZASJJBE0yPtk19YI=; b=PDy7hxmjeFZf7BTKeNXdct3aicMAFy/N3kj2esoTzZ23DRqNcdLiCRzMI3RHlotjIF GAG94mCudU+6uuFSJwLx9QAI0pytsPDhNGzVKIdsVkK/4zxUOi0AivC0ayt/iUWTn3Oq N4LM105MfoZPJ5tpS09xtHAD9ZJ+YfL0hVbzV7CHdvipqM31wL+O3ipSMn5sVDlwMkDF nX3ds3YrqpKR9VRN1CalTN6uFupj6zKNiNoqWfKsCEtDj8BxsLNnjf2b+JQk3lmq0hep UJMsdfzLxVcYiy/A4TiWMg+nQxG9hJKAAfLa57CaGYalkJX8TFGEw3CGCt0wYjy55IoM BVEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724054150; x=1724658950; 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=DFFP4yJko/fGjAhwqndZxir06xKZASJJBE0yPtk19YI=; b=C5j0Xw69xRBlRTYCVsmOuK7Lc4q+CTWiCwK13qC2bvNV5hvJ3/mp28nHjtrsqbCyWS h9cNbxYRwsJCHIgHBeirSHU8sKVCrMt2xsuW4Moa4MHMF4NRAYRsIUInbhNiRgufy2Rq RuG9zS8UGisP58QOO6PYbNIfceBtRo1xDZqG2O+ZxaxrPAjiI093c2njlxXVrkHdBvoe VztvCHmtoK30IyEyQhIioQLkyQUIgW8GZaXXRbMrQ5uH9ePt9jB1eStI/f7nFeivb5Vi JXtLqlNjaD88CDsbuMND0JhYgn3UVhJqQEc0rvbWFp2uXHMsKxQLnQzJI14gEJ78C1jP fnAg== X-Gm-Message-State: AOJu0Yxbxx1lk6FsxTor+Hs5XRGH36fxEpcK53Akiey3CprfG/0WzFY2 FGvKSewWWXScJgpz6OZXgbpWyYVjmDmo1Pj9Jq9zKE1gOhkBSPBVLeYa5ykZVWSmajTwIj5sivp IcZDCg+JidrWucLtJz7dzbB57XmG8/tU9 X-Google-Smtp-Source: AGHT+IHIHJOgV55Orwr02N3TK8Eb7Kb5ac52zhIPonddReg6TkayTVXu15yzXDPnIjMTuP8Q2emRut9WotGiWOxlA1M= X-Received: by 2002:a05:6512:10c2:b0:530:da95:b54c with SMTP id 2adb3069b0e04-5331c6acec2mr7458528e87.23.1724054149670; Mon, 19 Aug 2024 00:55:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Muhammad Ikram Date: Mon, 19 Aug 2024 12:55:32 +0500 Message-ID: Subject: Re: Insert query performance To: sud Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000002a3012062004a356" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002a3012062004a356 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sud, Please make following change in your postgresql.conf file log_statement =3D 'all' Regards, Ikram On Mon, Aug 19, 2024 at 12:48=E2=80=AFPM sud wrote: > Hello All, > > In a version 15.4 postgres database, Is it possible that , if we have two > big range partition tables with foreign key relationships between them, > insert into the child table can cause slowness if we don't have foreign k= ey > index present in the child table? Basically it need to make sure the new > row already added to parent partition table or not. > > > And if there is any possible way(example query tracing etc) to get the > underlying system queries which gets triggered as part of the main insert > query? For example in above scenario, postgres must be executing some que= ry > to check if the incoming row to the child table already exists in the > parent table or not? > > > Regards > > Sud > --=20 Muhammad Ikram --0000000000002a3012062004a356 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Sud,

Please make following change in= your postgresql.conf file

log_statement =3D '= all'=C2=A0


Regards,
Ikram


On Mon, Aug 19, 2024 at 12:48=E2=80=AFPM sud = <suds1434@gmail.com> wrote:=

Hello All,=C2=A0

In a version 15.4 post= gres database, Is it possible that , i= f we have two big range partition tables with foreign key relationships bet= ween them, insert into the child table can cause slowness if we don't h= ave foreign key index present in the child table? Basically it need to make= sure the new row already added to parent partition table or not.=C2=A0
=

=C2=A0
And if there is any possible way(examp= le query tracing etc) to get the underlying system queries which gets trigg= ered as part of the main insert query? For example in above scenario, postg= res must be executing some query to check if the incoming=C2=A0 row to the = child table already exists in the parent table or not?=C2=A0


Regards

Sud



--
Muhammad Ikram

--0000000000002a3012062004a356--