query codebook