List:MySQL on Win32« Previous MessageNext Message »
From:Jorge Bastos Date:November 6 2009 9:33am
Subject:RE: Help on query performance
View as plain text  
Howdy Jesper,

> Sorry - looked a bit further into you table syntax
> 
> Since both emp and ano are primary keys already - only set non-unique
> composite index on (arm_cod, cod_art)
> 
> Maybe you could enlighten me by explaing why using many primary indexes
> instead of on primary and several unique composite indexes
> 



Yap, after i sent the email i saw that i was missing the index's.
I always fall on that error :P






> 
> Setting non-unique composite index on (emp, ano, arm_cod, cod_art)
> should make the query real fast. Indexes are most important for finding
> what rows to look in. Ie in this case - the parameters within WHERE.
> Indexing columns that are not used in WHERE syntaxes or in JOIN
> syntaxes are rarely useful, only space consuming. Indexeing also
> somewhat slows down UPDATEs and INSERTs. Normally not a hazzle unless a
> lot of fields are often updated and inserted.
> 
> You ought to be fine with only non-unique composite index on (emp, ano,
> arm_cod, cod_art)
> 
> /Jesper

Thread
Help on query performanceJorge Bastos5 Nov
  • RE: Help on query performanceSandeep Tamhankar6 Nov
    • SV: Help on query performanceJesper Palmqvist  [Talarforum i Skandinavien AB]6 Nov
      • SV: Help on query performanceJesper Palmqvist  [Talarforum i Skandinavien AB]6 Nov
        • RE: Help on query performanceJorge Bastos6 Nov
        • RE: Help on query performanceSandeep Tamhankar6 Nov
          • RE: Help on query performancemos7 Nov
  • Re: Help on query performancemos6 Nov
    • RE: Help on query performanceJorge Bastos6 Nov
  • Re: Help on query performanceuwe6 Nov