Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXtvv-0002QN-NG for pgsql-admin@arkaria.postgresql.org; Sat, 06 Jan 2018 19:15:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXtvv-0002Vk-A8 for pgsql-admin@arkaria.postgresql.org; Sat, 06 Jan 2018 19:15:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eXtvv-0002VI-3Q; Sat, 06 Jan 2018 19:15:07 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eXtvr-000837-OE; Sat, 06 Jan 2018 19:15:06 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 3220BC0D41; Sat, 6 Jan 2018 19:15:01 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo01-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YGf2kBK16nmd; Sat, 6 Jan 2018 19:15:01 +0000 (UTC) Received: from [192.168.2.16] (unknown [8.39.228.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 3ADD2C0D3D; Sat, 6 Jan 2018 19:14:58 +0000 (UTC) From: scott ribe Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Ideas to deal with table corruption Date: Sat, 6 Jan 2018 12:14:56 -0700 References: To: pgsql-admin@postgresql.org, pgsql-general General In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Jan 6, 2018, at 12:11 PM, Corey Taylor = wrote: > Is it possible for an index to not exist on those columns? >=20 > = https://www.postgresql.org/docs/current/static/ddl-constraints.html#DDL-CO= NSTRAINTS-FK >=20 > "A foreign key must reference columns that either are a primary key or = form a unique constraint. This means that the referenced columns always = have an index (the one underlying the primary key or unique constraint); = so checks on whether a referencing row has a match will be efficient." One should also remember that the foreign key itself should usually be = indexed, lest a delete on the referenced table require a table scan on = the referencing table. -- Scott Ribe https://www.linkedin.com/in/scottribe/ (303) 722-0567