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 1t1Bgn-00F5yV-JE for pgsql-general@arkaria.postgresql.org; Wed, 16 Oct 2024 21:36:17 +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 1t1Bgl-00AcEu-PC for pgsql-general@arkaria.postgresql.org; Wed, 16 Oct 2024 21:36:16 +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 1t1Bgl-00AcEl-Ei for pgsql-general@lists.postgresql.org; Wed, 16 Oct 2024 21:36:15 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t1Bgj-001FXP-09 for pgsql-general@lists.postgresql.org; Wed, 16 Oct 2024 21:36:14 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 7C1A022EE5; Wed, 16 Oct 2024 23:36:10 +0200 (CEST) Date: Wed, 16 Oct 2024 23:36:10 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Query performance issue Message-ID: <20241016213610.wbfqj3r7gg5ba6eh@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="22e6kcim53mwrc7p" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --22e6kcim53mwrc7p Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-10-16 23:20:36 +0530, yudhi s wrote: > Below is a query which is running for ~40 seconds. [...] > In the execution path below , the line number marked in bold are the top = lines > for the IN and NOT IN subquery evaluation and they are showing "Actual ti= me" as > =A0Approx ~9 seconds and ~8 seconds and they seems to be summed up and th= e top > lines showing it to be ~19 seconds. Then onwards it keeps on increasing w= ith > other "nested loop" joins. >=20 > Note:- This query is running on a MYSQL 8.0 database. So I'm wondering if= there > is any mysql list similar to Oracle list , in which i can share this issu= e? The execution plan looks like a postgresql execution plan, not a mysql execution plan. Did you run this query on postgresql? That may be interesting for comparison purposese, but ultimately it is useless: You won't get mysql to work like postgresql, and any tips to speed up this query on postgresql (which is all you can expect on a postgresql mailing list) probably won't work on mysql. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --22e6kcim53mwrc7p Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmcQMcoACgkQ8g5IURL+ KF2QgQ//WDaksoBv9NMehbZvR45x06e5AidgKRnMYiHO8438WX3p/sdHIi2HS5wn cv9JqZX+EG54EIhtFOVpFiOpEFJGYQXOz5nLWeuFgWMr+35/G7Wkgp3+a4/mmQ3w jlwD0367zSoC8cXOuKfoZL89w4CwQ5XydH6+iv1EIEoaavBB7zrQmVfdlsJHCMMW QOhI2mYdkqsYVnRT1T/7ZLjaUwY+Cw5TDnpfLr0TgOEC8Riy7Yb7EPZTxbGTai/4 q/RooVnyK5OZUNW3pNnIOdKNlSaAJFcxnYBa+HaPHU4S/N7HC0OI9T7f+uAZRGLK 6K+4gZwRf6iqlIW1uYEJ0hd1bUYOTPf7I8XdF0O7aWyFeR74/H0JnAze73Ed+3YJ HmePDkuwPh938fwy7KaTpxd+UeSvD1wTCbT0AQkGqUj75IsZrY3+DTrB05vQdiw0 57jIR/aNLwrSETzZBkJAsesn+v+V4Q2dxrXfWC2bEjouq3D+83IOY6nYfPlUcDrU r2260HTvrPc/Yb8/+sOmAUQWR1Mjft6BcOfpDZcqx1wh1NCj4GXPM0h5lDr39EZx RnQ9mjhOnowIbwzgvL/aekM2DmfRFH5/6vJoFhckVxOpNKNEmrst8Q+1Tirak0u/ cgoaqDIJmE1mHpax9TExr2ilKkhD+yYbINTU+EQ9QkaAgdJhaeU= =If4D -----END PGP SIGNATURE----- --22e6kcim53mwrc7p--