Re: primary key vs covered index
marcin kot Wrote:
-------------------------------------------------------
> I would like to get all columns from the index
> dokumenty_multi_i2 without column PLIK mediumblob.
> How to rewrite query or reindex table?
Hi,
If the BLOB is large, it will not be stored within the ordinary data page. Hence, I do not see that there should be any performance benefit from using another index than the PRIMARY here. You can of course force the query to use the other index:
SELECT lp,opis,naz ,dat_dod,oso_dod
FROM dokumenty FORCE INDEX(dokumenty_multi_i2)
WHERE id_dok=37399;
However, I do not believe this will run any faster.
Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway