correct select statement for reading from temp_file_metadata
print out the offset during the while loops