Add master query.