New query model for RefDBs