Added dbGetQueryBatchWise function (mostly for avoiding Postgres errors with large queries)