diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index 42dcb11..863172a 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -1853,6 +1853,10 @@ get_loop_count(PlannerInfo *root, Relids outer_relids)
 				continue;
 			Assert(outer_rel->relid == relid);	/* sanity check on array */
 
+			/* skip dead rels as they will have no estimates. */
+			if (outer_rel->reloptkind == RELOPT_DEADREL)
+				continue;
+
 			/* Other relation could be proven empty, if so ignore */
 			if (IS_DUMMY_REL(outer_rel))
 				continue;
