Improve database record filtering in UI