Just thought I would share with ya. Since running so many single record queries can be a bottleneck for performance.
I found considerable speed up when querying my dataset by simply returning my indexes in the getitem function.
Then the list provided to a custom collate function can be converted to a tuple and used with a WHERE IN query which returns the batch records in a single query,