do not query database if offset is more than total