Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is due to the default LIMIT value of every FQL query (LIMIT 100).</p> <ol> <li><p>Firstly <strong>SELECT uid2 FROM friend WHERE uid1=me()</strong> query runs and outputs your 100 friends</p></li> <li><p>Secondly <strong>SELECT aid FROM album WHERE owner IN (..100 Friends...)</strong> query runs and output s100 albums of ur 100 friends.</p></li> <li><p>Finally SELECT <strong>pid, caption, aid, owner, link, src_big, src_small, created, modified, like_info FROM photo WHERE created > 1325356200 and aid IN (...100 Aid...) ORDER BY like_info.like_count DESC LIMIT 30</strong> query runs and outputs the result from 100 albums.</p></li> </ol> <p>Apparently the result is not at all what u wanted. You might try to increase your limit by yourself (say LIMIT 1000) but it never worked for me. The only way of getting accurate result is trying graph API, but it will take very long time for executing, eventually its a dead choice.</p> <p>The Proof for my answer</p> <p>Try to run these codes</p> <pre><code>SELECT pid, caption, aid, owner, link, src_big, src_small, created, modified, like_info FROM photo WHERE created &gt; 1325356200 and aid IN (SELECT aid FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1=me() order by rand() ))ORDER BY like_info DESC LIMIT 30 </code></pre> <p>I used rand() function to randomize the friends</p> <pre><code>SELECT pid, caption, aid, owner, link, src_big, src_small, created, modified, like_info FROM photo WHERE created &gt; 1325356200 and aid IN (SELECT aid FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1=me() ) order by rand() ) ORDER BY like_info DESC LIMIT 30 </code></pre> <p>Here i used rand() to randomize the albums. You can try to randomize the both queries. Every time u execute these codes it will give very different result and you would notice there are many more pictures with many more likes.</p>
    singulars
    1. This table or related slice is empty.
    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.
    3. 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