Use RelationGetNumberOfAttributes to get number of columns in CStoreGetForeignPaths.