Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>What is the best Index to improve the performance for my query?</p> </blockquote> <p>a <strong>clustered primary key</strong></p> <p><a href="http://dev.mysql.com/doc/refman/5.0/en/innodb-index-types.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/innodb-index-types.html</a></p> <p><a href="http://www.xaprb.com/blog/2006/07/04/how-to-exploit-mysql-index-optimizations/" rel="nofollow noreferrer">http://www.xaprb.com/blog/2006/07/04/how-to-exploit-mysql-index-optimizations/</a></p> <p><a href="https://stackoverflow.com/questions/4419499/mysql-nosql-help-me-to-choose-the-right-one-on-a/4421601#4421601">MySQL and NoSQL: Help me to choose the right one</a></p> <p><a href="https://stackoverflow.com/questions/5451190/60-million-entries-select-entries-from-a-certain-month-how-to-optimize-databas/5451389#5451389">60 million entries, select entries from a certain month. How to optimize database?</a></p> <p><a href="https://stackoverflow.com/questions/5472241/how-to-avoid-using-temporary-in-many-to-many-queries/5473513#5473513">How to avoid &quot;Using temporary&quot; in many-to-many queries?</a></p> <p>however your current clustered PK <strong>sid</strong> wont be much help so try something along the lines of:</p> <pre><code>create table forwarding ( f_date date not null, f_shop int unsigned not null, sid int unsigned not null, -- added for uniqueness ... primary key (f_date, f_shop, sid) -- clustered primary key ) engine=innodb; </code></pre> <p>hope this helps :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload