A multimedia database system should deal efficiently with both image compression and retrieval functions. It is critical to develop image indexing techniques that search databases based on their content in a compressed domain. We propose a new scheme, query by index image, based on vector quantization, to facilitate image retrieval in a compressed domain. The proposed algorithm exploits different index images obtained by sorting codevectors to capture various kinds of image feature. Hence, intrablock correlation and interblock correlation in an image can be efficiently represented. Our proposed algorithm not only can extract features from the pixel domain but also from a transform domain, such as that of wavelet coefficients. Experimental results demonstrate that the retrieval performance of the proposed scheme is more accurate than that of other similar methods.