using metadata in database instead of counting rows to resolve problems in previewing large datasets.