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 1rj4LS-003Guc-2g for pgsql-general@arkaria.postgresql.org; Sat, 09 Mar 2024 21:35:06 +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 1rj4LQ-002F3P-6w for pgsql-general@arkaria.postgresql.org; Sat, 09 Mar 2024 21:35:04 +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 1rj4LP-002F31-SV for pgsql-general@lists.postgresql.org; Sat, 09 Mar 2024 21:35:04 +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 1rj4LJ-003gzc-Es for pgsql-general@lists.postgresql.org; Sat, 09 Mar 2024 21:35:03 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 1DD7217187; Sat, 9 Mar 2024 22:34:55 +0100 (CET) Date: Sat, 9 Mar 2024 22:34:55 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: creating a subset DB efficiently ? Message-ID: <20240309213455.i2trc3sc4caxoqel@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="3xpmm2nan4v3kigj" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --3xpmm2nan4v3kigj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-03-08 11:22:17 -0500, David Gauthier wrote: > Related question... > The "delete from par_tbl_a where project <> 'a' " is taking forever. Have you checked whether all the FK columns have an index? Otherwise checking for references means a full table scan which may take a long time. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --3xpmm2nan4v3kigj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmXs1fQACgkQ8g5IURL+ KF0kuA/+Kv4CKoJDz8W1QmF4Z9S8z+Xr4Hv3d2yTu1HQ4k45J4q796kr00INrS7D b3feuWuX2FjEEm2BXjvapw1nxQDiOZ5TTqu+wm92yNVNf4lJAl4sq9vB2m/dsbqr px4arRIEJjzKxcBd6kHVKdKfPZXNwbUN43qVTxYGmKFVAm9Prs/bbkBVBoDPdz+l 4AWMgD9mJQDS5kfQ03m/H3+c1sa72la6qx5rh1hZ4xFlxUTLzH4BTuPddRBHOlWQ LZFsAhJnR10pRw3n/ai036JtMbcREe1wc7UXOBbzZxKFOge90xIQXwwxWFgL9xN4 VtTSYEn6Bu+qD5x9ZAgUVOIgFFfinAIP03joMlp3mJlAgMpMu8KfaISIn0vcTOUQ 1KF2cXIWtx9sDW/S1krZ2r0Ji+bF4Awbtp7h8WZV4gJlgl3VJ1WW+7uAYSAKpg+4 fn4HBV+Dn/G9MxiKM8qp7ngnvCZsrwQnYo17XNcRCw2Xw3fzXyZBbAIM2YLa3EKa 5M6p3zhEqdCr9FwvpMJQUkMEgyaoXyLhu7RFyyLvYJs2a7Xl7xpelnrLC5MjDv2X c0HeW50zyXAZVCkiGmlcEFEoEEeUGl+OXObJMQKXzvcNQoc/Z7tn1NZeewu32OF0 9ZOHDnk0dKdzeG4f+Z5EX7DzxIDKHOsbi2Lwas/kq0aoWG9wCAE= =2GLa -----END PGP SIGNATURE----- --3xpmm2nan4v3kigj--