MySQL Forums
Forum List  »  General

Re: Mysql trouble with table definition creating fulltable scan
Posted by: Rick James
Date: May 23, 2016 02:32PM

What version of MySQL?

Please provide EXPLAIN FORMAT=JSON SELECT ...

    select  specie5_.specie as col_5_0_, paziente3_.cognome as col_8_0_
        from  Analisi analisi0_
        inner join  Paziente paziente3_ on analisi0_.ID_PAZIENTE=paziente3_.ID_PAZIENTE
        inner join  Specie specie5_ on paziente3_.ID_SPECIE=specie5_.ID_SPECIE
        where  paziente3_.nome like 'MARCO%'

Try two things:

Try LEFT:
        LEFT join  Specie specie5_ on paziente3_.ID_SPECIE=specie5_.ID_SPECIE

Try

    select  
          ( SELECT  specie
                FROM  Specie
                WHERE  paziente3_.ID_SPECIE = ID_SPECIE 
          ) AS col_5_0_, paziente3_.cognome as col_8_0_
        from  Analisi analisi0_
        inner join  Paziente paziente3_ on analisi0_.ID_PAZIENTE=paziente3_.ID_PAZIENTE
        where  paziente3_.nome like 'MARCO%'

Options: ReplyQuote


Subject
Written By
Posted
Re: Mysql trouble with table definition creating fulltable scan
May 23, 2016 02:32PM


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.