MySQL Forums
Forum List  »  Optimizer & Parser

Re: primary key vs covered index
Posted by: Øystein Grøvlen
Date: December 01, 2016 03:57AM

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?


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

Options: ReplyQuote

Written By
November 30, 2016 09:55AM
December 01, 2016 01:39AM
December 01, 2016 03:38AM
Re: primary key vs covered index
December 01, 2016 03:57AM
December 01, 2016 04:16AM
December 01, 2016 04:25AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.