title: select taking a lot of time on table with many rows
body: <p>I have this select:</p>
  
  <pre><code>select 'like' prefix
       , l.post
       , l.data as data
       , l.user
       , concat(k.user, ' liked you') as logs 
    from likes l 
  
  inner join posts p on l.post = p.id 
  inner join cadastro k on l.user = k.id 
  where p.user = 1 and l.user &lt;&gt; p.user
  
  order by data desc
  limit 10
  </code></pre>
  
  <p>it took 2.3993 seconds.</p>
  
  <p><a href="https://i.stack.imgur.com/Etsgk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Etsgk.jpg" alt="enter image description here"></a>
  any ideas to improve?</p>
  
  <pre><code>`likes` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `user` int(11) UNSIGNED NOT NULL,
    `post` int(11) UNSIGNED NOT NULL,
    `data` datetime NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `user_post` (`user`,`post`),
    KEY `post_user` (post, user),
    FOREIGN KEY (`user`) REFERENCES cadastro (`id`),
    FOREIGN KEY (`post`) REFERENCES posts (`id`) ON DELETE CASCADE
  )
  
  `posts` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  
  `cadastro` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  </code></pre>
  
  <p>any ideas to speed this up? I also tried to add index on likes data, but no diference noticed.</p>