adds an attribute to specify a query on foreign table