WIP: Full-fledged query buffers