} else {
//no post filter, we have a preFilter, or preFilter is null..
// either way we can use the datastore optimization
Connection cx = dataStore.getConnection(getState());
try {
DefaultQuery q = new DefaultQuery(query);
q.setFilter(preFilter);
int count = dataStore.getCount(getSchema(), q, cx);
// if native support for limit and offset is not implemented, we have to ajust the result
if(!dataStore.getSQLDialect().isLimitOffsetSupported()) {
if(query.getStartIndex() != null && query.getStartIndex() > 0) {
if(query.getStartIndex() > count)