title: Find smallest thumbnail in WordPress mySQL database
body: <p>I have a PHP code that fetches a thumbnail from the WordPress mySQL database. </p>
  
  <p>There is already a <strong>post id</strong> value in the code which is used to grab <strong>meta_value</strong> in the table <strong>wp_postmeta</strong>. Finally i get the thumbnail url in the <strong>guid</strong> column of <strong>wp_posts</strong> </p>
  
  <pre><code>SELECT meta_value,guid 
  FROM wp_postmeta
  LEFT JOIN wp_posts ON wp_postmeta.meta_value=wp_posts.ID 
  WHERE post_id=:id AND meta_key='_thumbnail_id' LIMIT 1
  </code></pre>
  
  <p>Everything works great, EXCEPT that its always the original uploaded image which is sometimes megabytes in size. I only need a 150x150 thumbnail which i see is an actual option in <strong>wp-admin -> settings -> media</strong></p>
  
  <p>Where can i grab the smallest version of the thumbnail? I assume that its already created by WordPress </p>