SQL iterchunks and extend_chunks