use less buffer and queries