ERROR: variable not found in subplan target list (setrefs.c:2176)
select relname,reltuples from pg_class where relname like '<tablename>%'; select count(*) from <tablename>;
Usually analyzing the tables will fix the issue. However, if it does not, then please log a case with Support.
This issue is also fixed in Greenplum 5.24.0. If you face this issue in earlier releases of Greenplum 5.x, it is recommended that you upgrade.